diff options
author | Melanie | 2011-01-12 21:39:13 +0000 |
---|---|---|
committer | Melanie | 2011-01-12 21:39:13 +0000 |
commit | 914e4b319ee0adba72bfbfebd878827bfdfde843 (patch) | |
tree | 5e48c12157f98fe2529f9c5c7781bc18488266c8 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |
parent | Use ToString() rather than a cast (more robust) (diff) | |
download | opensim-SC-914e4b319ee0adba72bfbfebd878827bfdfde843.zip opensim-SC-914e4b319ee0adba72bfbfebd878827bfdfde843.tar.gz opensim-SC-914e4b319ee0adba72bfbfebd878827bfdfde843.tar.bz2 opensim-SC-914e4b319ee0adba72bfbfebd878827bfdfde843.tar.xz |
Fix direct item give permissions
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 900130a..91bb3a5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -629,14 +629,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
629 | 629 | ||
630 | group.SetGroup(m_part.GroupID, null); | 630 | group.SetGroup(m_part.GroupID, null); |
631 | 631 | ||
632 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) | 632 | // TODO: Remove magic number badness |
633 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
633 | { | 634 | { |
634 | if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) | 635 | if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) |
635 | { | 636 | { |
636 | foreach (SceneObjectPart part in partList) | 637 | foreach (SceneObjectPart part in partList) |
637 | { | 638 | { |
638 | part.EveryoneMask = item.EveryonePermissions; | 639 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) |
639 | part.NextOwnerMask = item.NextPermissions; | 640 | part.EveryoneMask = item.EveryonePermissions; |
641 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
642 | part.NextOwnerMask = item.NextPermissions; | ||
643 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
644 | part.GroupMask = item.GroupPermissions; | ||
640 | } | 645 | } |
641 | 646 | ||
642 | group.ApplyNextOwnerPermissions(); | 647 | group.ApplyNextOwnerPermissions(); |
@@ -645,15 +650,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
645 | 650 | ||
646 | foreach (SceneObjectPart part in partList) | 651 | foreach (SceneObjectPart part in partList) |
647 | { | 652 | { |
648 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) | 653 | // TODO: Remove magic number badness |
654 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
649 | { | 655 | { |
650 | part.LastOwnerID = part.OwnerID; | 656 | part.LastOwnerID = part.OwnerID; |
651 | part.OwnerID = item.OwnerID; | 657 | part.OwnerID = item.OwnerID; |
652 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | 658 | part.Inventory.ChangeInventoryOwner(item.OwnerID); |
653 | } | 659 | } |
654 | 660 | ||
655 | part.EveryoneMask = item.EveryonePermissions; | 661 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) |
656 | part.NextOwnerMask = item.NextPermissions; | 662 | part.EveryoneMask = item.EveryonePermissions; |
663 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
664 | part.NextOwnerMask = item.NextPermissions; | ||
665 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
666 | part.GroupMask = item.GroupPermissions; | ||
657 | } | 667 | } |
658 | 668 | ||
659 | rootPart.TrimPermissions(); | 669 | rootPart.TrimPermissions(); |