diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e3ccf96..9c8dbb6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -681,13 +681,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
681 | // a mask | 681 | // a mask |
682 | if (item.InvType == (int)InventoryType.Object) | 682 | if (item.InvType == (int)InventoryType.Object) |
683 | { | 683 | { |
684 | // Create a safe mask for the current perms | ||
685 | uint foldedPerms = (item.CurrentPermissions & 7) << 13; | ||
686 | foldedPerms |= permsMask; | ||
687 | |||
684 | bool isRootMod = (item.CurrentPermissions & | 688 | bool isRootMod = (item.CurrentPermissions & |
685 | (uint)PermissionMask.Modify) != 0 ? | 689 | (uint)PermissionMask.Modify) != 0 ? |
686 | true : false; | 690 | true : false; |
687 | 691 | ||
688 | // Mask the owner perms to the folded perms | 692 | // Mask the owner perms to the folded perms |
689 | PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref ownerPerms); | 693 | ownerPerms &= foldedPerms; |
690 | PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref basePerms); | 694 | basePerms &= foldedPerms; |
691 | 695 | ||
692 | // If the root was mod, let the mask reflect that | 696 | // If the root was mod, let the mask reflect that |
693 | // We also need to adjust the base here, because | 697 | // We also need to adjust the base here, because |
@@ -1240,19 +1244,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1240 | { | 1244 | { |
1241 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1245 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
1242 | if (taskItem.InvType == (int)InventoryType.Object) | 1246 | if (taskItem.InvType == (int)InventoryType.Object) |
1243 | { | 1247 | agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move)); |
1244 | // Bake the new base permissions from folded permissions | 1248 | else |
1245 | // The folded perms are in the lowest 3 bits of the current perms | 1249 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; |
1246 | // We use base permissions here to avoid baking the "Locked" status | ||
1247 | // into the item as it is passed. | ||
1248 | uint perms = taskItem.BasePermissions & taskItem.NextPermissions; | ||
1249 | PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms); | ||
1250 | // Avoid the "lock trap" - move must always be enabled but the above may remove it | ||
1251 | // Add it back here. | ||
1252 | agentItem.BasePermissions = perms | (uint)PermissionMask.Move; | ||
1253 | // Newly given items cannot be "locked" on rez. Make sure by | ||
1254 | // setting current equal to base. | ||
1255 | } | ||
1256 | 1250 | ||
1257 | agentItem.CurrentPermissions = agentItem.BasePermissions; | 1251 | agentItem.CurrentPermissions = agentItem.BasePermissions; |
1258 | 1252 | ||