From e68867c9b6efd72a72d158deab16484b37faab46 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 25 May 2014 11:47:04 +0300 Subject: When taking an object into inventory, set the inventory item's "Next Owner" permissions according to the permissions of the items in the object --- .../Framework/InventoryAccess/InventoryAccessModule.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index c4a42bc..b4771fd 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -556,6 +556,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) { + // Changing ownership, so apply the "Next Owner" permissions to all of the + // inventory item's permissions. + uint perms = effectivePerms; PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms); @@ -570,6 +573,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } else { + // Not changing ownership. + // In this case we apply the permissions in the object's items ONLY to the inventory + // item's "Next Owner" permissions, but NOT to its "Current", "Base", etc. permissions. + // E.g., if the object contains a No-Transfer item then the item's "Next Owner" + // permissions are also No-Transfer. + PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref allObjectsNextOwnerPerms); + item.BasePermissions = effectivePerms; item.CurrentPermissions = effectivePerms; item.NextPermissions = allObjectsNextOwnerPerms & effectivePerms; -- cgit v1.1