diff options
author | UbitUmarov | 2017-04-29 19:07:04 +0100 |
---|---|---|
committer | UbitUmarov | 2017-04-29 19:07:04 +0100 |
commit | 04117d9f75ca278a921be9ce09c8c859f81cd428 (patch) | |
tree | 3a919f3e3d2eb3c0ea22bcb7fefa9fdd5e0541e0 /OpenSim/Region | |
parent | add check for valid folded perms (diff) | |
download | opensim-SC_OLD-04117d9f75ca278a921be9ce09c8c859f81cd428.zip opensim-SC_OLD-04117d9f75ca278a921be9ce09c8c859f81cd428.tar.gz opensim-SC_OLD-04117d9f75ca278a921be9ce09c8c859f81cd428.tar.bz2 opensim-SC_OLD-04117d9f75ca278a921be9ce09c8c859f81cd428.tar.xz |
recover PermissionsUtil.ApplyFoldedPermissions (well my version). its use easys code readability
Diffstat (limited to 'OpenSim/Region')
3 files changed, 20 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index d916cc2..bce0610 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -573,7 +573,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
573 | InventoryItemBase item, SceneObjectGroup so, List<SceneObjectGroup> objsForEffectivePermissions, | 573 | InventoryItemBase item, SceneObjectGroup so, List<SceneObjectGroup> objsForEffectivePermissions, |
574 | IClientAPI remoteClient) | 574 | IClientAPI remoteClient) |
575 | { | 575 | { |
576 | uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; | 576 | uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export | PermissionMask.FoldedMask); |
577 | 577 | ||
578 | // For the porposes of inventory, an object is modify if the prims | 578 | // For the porposes of inventory, an object is modify if the prims |
579 | // are modify. This allows renaming an object that contains no | 579 | // are modify. This allows renaming an object that contains no |
@@ -586,19 +586,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
586 | 586 | ||
587 | effectivePerms &= groupPerms; | 587 | effectivePerms &= groupPerms; |
588 | } | 588 | } |
589 | effectivePerms |= (uint)PermissionMask.Move; | 589 | |
590 | |||
591 | if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) | 590 | if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) |
592 | { | 591 | { |
593 | if ((effectivePerms & (uint)PermissionMask.FoldedCopy) == 0) | 592 | PermissionsUtil.ApplyNoModFoldedPermissions(effectivePerms, ref effectivePerms); |
594 | effectivePerms &= ~(uint)PermissionMask.Copy; | 593 | |
595 | if ((effectivePerms & (uint)PermissionMask.FoldedTransfer) == 0) | ||
596 | effectivePerms &= ~(uint)PermissionMask.Transfer; | ||
597 | if ((effectivePerms & (uint)PermissionMask.FoldedExport) == 0) | ||
598 | effectivePerms &= ~(uint)PermissionMask.Export; | ||
599 | |||
600 | uint basePerms = effectivePerms & so.RootPart.NextOwnerMask; | 594 | uint basePerms = effectivePerms & so.RootPart.NextOwnerMask; |
601 | 595 | ||
596 | // rebuild folded perms since we don't have then on inworld objects | ||
597 | // possible existent ones where already unfolded | ||
598 | |||
602 | if((basePerms & (uint)PermissionMask.Copy) == 0) | 599 | if((basePerms & (uint)PermissionMask.Copy) == 0) |
603 | basePerms |= (uint)PermissionMask.Transfer; | 600 | basePerms |= (uint)PermissionMask.Transfer; |
604 | 601 | ||
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index f90285d..84f33d1 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -208,19 +208,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
208 | 208 | ||
209 | perms = group.GetEffectivePermissions(false); | 209 | perms = group.GetEffectivePermissions(false); |
210 | 210 | ||
211 | // if((perms & (uint)PermissionMask.FoldedMask) != 0) | 211 | PermissionsUtil.ApplyFoldedPermissions(perms, ref perms); |
212 | { | 212 | |
213 | if ((perms & (uint)PermissionMask.FoldedCopy) == 0) | ||
214 | perms &= ~(uint)PermissionMask.Copy; | ||
215 | if ((perms & (uint)PermissionMask.FoldedTransfer) == 0) | ||
216 | perms &= ~(uint)PermissionMask.Transfer; | ||
217 | if ((perms & (uint)PermissionMask.FoldedModify) == 0) | ||
218 | perms &= ~(uint)PermissionMask.Modify; | ||
219 | if ((perms & (uint)PermissionMask.FoldedExport) == 0) | ||
220 | perms &= ~(uint)PermissionMask.Export; | ||
221 | } | ||
222 | item.BasePermissions = perms & part.NextOwnerMask; | 213 | item.BasePermissions = perms & part.NextOwnerMask; |
223 | item.CurrentPermissions = perms & part.NextOwnerMask; | 214 | |
215 | // we need to rebuild folded here | ||
216 | |||
217 | item.CurrentPermissions = item.BasePermissions; | ||
224 | item.NextPermissions = part.NextOwnerMask; | 218 | item.NextPermissions = part.NextOwnerMask; |
225 | item.EveryOnePermissions = part.EveryoneMask & | 219 | item.EveryOnePermissions = part.EveryoneMask & |
226 | part.NextOwnerMask; | 220 | part.NextOwnerMask; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index a6f6aa3..5e19a8a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1267,17 +1267,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1267 | // TODO: Fix this after the inventory fixer exists and has beenr run | 1267 | // TODO: Fix this after the inventory fixer exists and has beenr run |
1268 | if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) | 1268 | if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) |
1269 | { | 1269 | { |
1270 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1270 | agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions; |
1271 | if (taskItem.InvType == (int)InventoryType.Object) | 1271 | if (taskItem.InvType == (int)InventoryType.Object) |
1272 | { | 1272 | { |
1273 | if((taskItem.CurrentPermissions & (uint)PermissionMask.FoldedMask) != 0) | 1273 | uint perms = agentItem.BasePermissions; |
1274 | agentItem.BasePermissions &= | 1274 | PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms ); |
1275 | (((taskItem.CurrentPermissions & (uint)PermissionMask.FoldedMask ) << (int)PermissionMask.FoldingShift) | | 1275 | agentItem.BasePermissions = perms; |
1276 | (taskItem.CurrentPermissions & (uint)PermissionMask.Move)); | ||
1277 | } | 1276 | } |
1278 | else | 1277 | else |
1279 | agentItem.BasePermissions &= taskItem.CurrentPermissions; | 1278 | agentItem.BasePermissions &= taskItem.CurrentPermissions; |
1280 | 1279 | ||
1280 | // always unlock | ||
1281 | agentItem.BasePermissions |= (uint)PermissionMask.Move; | ||
1282 | |||
1281 | agentItem.CurrentPermissions = agentItem.BasePermissions; | 1283 | agentItem.CurrentPermissions = agentItem.BasePermissions; |
1282 | 1284 | ||
1283 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | 1285 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |