diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index c4a42bcecc..b4771fd2ca 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;