diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 3489873..3c120ff 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1227,16 +1227,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1227 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1227 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
1228 | if (taskItem.InvType == (int)InventoryType.Object) | 1228 | if (taskItem.InvType == (int)InventoryType.Object) |
1229 | { | 1229 | { |
1230 | uint perms = taskItem.CurrentPermissions; | 1230 | // Bake the new base permissions from folded permissions |
1231 | // The folded perms are in the lowest 3 bits of the current perms | ||
1232 | // We use base permissions here to avoid baking the "Locked" status | ||
1233 | // into the item as it is passed. | ||
1234 | uint perms = taskItem.BasePermissions & taskItem.NextPermissions; | ||
1231 | PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms); | 1235 | PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms); |
1236 | // Avoid the "lock trap" - move must always be enabled but the above may remove it | ||
1237 | // Add it back here. | ||
1232 | agentItem.BasePermissions = perms | (uint)PermissionMask.Move; | 1238 | agentItem.BasePermissions = perms | (uint)PermissionMask.Move; |
1233 | agentItem.CurrentPermissions = agentItem.BasePermissions; | 1239 | // Newly given items cannot be "locked" on rez. Make sure by |
1234 | } | 1240 | // setting current equal to base. |
1235 | else | ||
1236 | { | ||
1237 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; | ||
1238 | } | 1241 | } |
1239 | 1242 | ||
1243 | agentItem.CurrentPermissions = agentItem.BasePermissions; | ||
1244 | |||
1240 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | 1245 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
1241 | agentItem.NextPermissions = taskItem.NextPermissions; | 1246 | agentItem.NextPermissions = taskItem.NextPermissions; |
1242 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1247 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |