diff options
author | Melanie Thielker | 2017-01-06 13:17:43 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-01-06 13:17:43 +0000 |
commit | 4385d7d6934443530c1e14976e40f01dc90175bf (patch) | |
tree | 0d681647272df3422fff6d09f7d3f126f42a7b3d /OpenSim/Region/Framework | |
parent | restore parcels avatars visibility god level change correct handling; try to... (diff) | |
download | opensim-SC-4385d7d6934443530c1e14976e40f01dc90175bf.zip opensim-SC-4385d7d6934443530c1e14976e40f01dc90175bf.tar.gz opensim-SC-4385d7d6934443530c1e14976e40f01dc90175bf.tar.bz2 opensim-SC-4385d7d6934443530c1e14976e40f01dc90175bf.tar.xz |
Fix errors introduced by incomplete understanding of what folded perms are
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 19 |
2 files changed, 22 insertions, 21 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 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index a50f162..45c3ebd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -1358,12 +1358,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1358 | { | 1358 | { |
1359 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) | 1359 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) |
1360 | { | 1360 | { |
1361 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | 1361 | // m_log.DebugFormat ( |
1362 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; | 1362 | // "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", |
1363 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | 1363 | // item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); |
1364 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | 1364 | |
1365 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | 1365 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) |
1366 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; | 1366 | { |
1367 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | ||
1368 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; | ||
1369 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | ||
1370 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | ||
1371 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | ||
1372 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; | ||
1373 | } | ||
1367 | } | 1374 | } |
1368 | item.CurrentPermissions &= item.NextPermissions; | 1375 | item.CurrentPermissions &= item.NextPermissions; |
1369 | item.BasePermissions &= item.NextPermissions; | 1376 | item.BasePermissions &= item.NextPermissions; |