diff options
author | Melanie | 2011-01-12 16:20:38 +0100 |
---|---|---|
committer | Melanie | 2011-01-12 16:20:38 +0100 |
commit | 7f99a8c900251c59bc7cb7d8309a14ad5360de42 (patch) | |
tree | 3859626c6eb4f2f8d05fcbc7f0a7c270671fcecd /OpenSim/Region/CoreModules | |
parent | Remove old guids from the examples, for completeness' sake (diff) | |
download | opensim-SC_OLD-7f99a8c900251c59bc7cb7d8309a14ad5360de42.zip opensim-SC_OLD-7f99a8c900251c59bc7cb7d8309a14ad5360de42.tar.gz opensim-SC_OLD-7f99a8c900251c59bc7cb7d8309a14ad5360de42.tar.bz2 opensim-SC_OLD-7f99a8c900251c59bc7cb7d8309a14ad5360de42.tar.xz |
Fix direct item give permissions
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | 2 |
2 files changed, 20 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 623cd3a..10e74ea 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -511,10 +511,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
511 | item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask; | 511 | item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask; |
512 | item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask; | 512 | item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask; |
513 | 513 | ||
514 | // Magic number badness. Maybe this deserves an enum. | 514 | item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
515 | // bit 4 (16) is the "Slam" bit, it means treat as passed | ||
516 | // and apply next owner perms on rez | ||
517 | item.CurrentPermissions |= 16; // Slam! | ||
518 | } | 515 | } |
519 | else | 516 | else |
520 | { | 517 | { |
@@ -794,8 +791,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
794 | } | 791 | } |
795 | 792 | ||
796 | group.SetGroup(remoteClient.ActiveGroupId, remoteClient); | 793 | group.SetGroup(remoteClient.ActiveGroupId, remoteClient); |
794 | // TODO: Remove the magic number badness | ||
797 | if ((rootPart.OwnerID != item.Owner) || | 795 | if ((rootPart.OwnerID != item.Owner) || |
798 | (item.CurrentPermissions & 16) != 0) | 796 | (item.CurrentPermissions & 16) != 0 || // Magic number |
797 | (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) | ||
799 | { | 798 | { |
800 | //Need to kill the for sale here | 799 | //Need to kill the for sale here |
801 | rootPart.ObjectSaleType = 0; | 800 | rootPart.ObjectSaleType = 0; |
@@ -807,10 +806,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
807 | { | 806 | { |
808 | if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) | 807 | if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) |
809 | { | 808 | { |
810 | part.EveryoneMask = item.EveryOnePermissions; | 809 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) |
811 | part.NextOwnerMask = item.NextPermissions; | 810 | part.EveryoneMask = item.EveryOnePermissions; |
811 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
812 | part.NextOwnerMask = item.NextPermissions; | ||
813 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
814 | part.GroupMask = item.GroupPermissions; | ||
812 | } | 815 | } |
813 | part.GroupMask = 0; // DO NOT propagate here | ||
814 | } | 816 | } |
815 | 817 | ||
816 | group.ApplyNextOwnerPermissions(); | 818 | group.ApplyNextOwnerPermissions(); |
@@ -819,16 +821,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
819 | 821 | ||
820 | foreach (SceneObjectPart part in group.Parts) | 822 | foreach (SceneObjectPart part in group.Parts) |
821 | { | 823 | { |
824 | // TODO: Remove the magic number badness | ||
822 | if ((part.OwnerID != item.Owner) || | 825 | if ((part.OwnerID != item.Owner) || |
823 | (item.CurrentPermissions & 16) != 0) | 826 | (item.CurrentPermissions & 16) != 0 || // Magic number |
827 | (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) | ||
824 | { | 828 | { |
825 | part.LastOwnerID = part.OwnerID; | 829 | part.LastOwnerID = part.OwnerID; |
826 | part.OwnerID = item.Owner; | 830 | part.OwnerID = item.Owner; |
827 | part.Inventory.ChangeInventoryOwner(item.Owner); | 831 | part.Inventory.ChangeInventoryOwner(item.Owner); |
828 | part.GroupMask = 0; // DO NOT propagate here | ||
829 | } | 832 | } |
830 | part.EveryoneMask = item.EveryOnePermissions; | 833 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) |
831 | part.NextOwnerMask = item.NextPermissions; | 834 | part.EveryoneMask = item.EveryOnePermissions; |
835 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
836 | part.NextOwnerMask = item.NextPermissions; | ||
837 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
838 | part.GroupMask = item.GroupPermissions; | ||
832 | } | 839 | } |
833 | 840 | ||
834 | rootPart.TrimPermissions(); | 841 | rootPart.TrimPermissions(); |
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 568ba19..be399ff 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
215 | part.NextOwnerMask; | 215 | part.NextOwnerMask; |
216 | item.GroupPermissions = part.GroupMask & | 216 | item.GroupPermissions = part.GroupMask & |
217 | part.NextOwnerMask; | 217 | part.NextOwnerMask; |
218 | item.CurrentPermissions |= 16; // Slam! | 218 | item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
219 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 219 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
220 | 220 | ||
221 | if (m_scene.AddInventoryItem(item)) | 221 | if (m_scene.AddInventoryItem(item)) |