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/CoreModules | |
parent | restore parcels avatars visibility god level change correct handling; try to... (diff) | |
download | opensim-SC_OLD-4385d7d6934443530c1e14976e40f01dc90175bf.zip opensim-SC_OLD-4385d7d6934443530c1e14976e40f01dc90175bf.tar.gz opensim-SC_OLD-4385d7d6934443530c1e14976e40f01dc90175bf.tar.bz2 opensim-SC_OLD-4385d7d6934443530c1e14976e40f01dc90175bf.tar.xz |
Fix errors introduced by incomplete understanding of what folded perms are
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | 8 |
2 files changed, 18 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index fcf373b..4fb4cc2 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -532,17 +532,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
532 | } | 532 | } |
533 | else | 533 | else |
534 | { | 534 | { |
535 | AddPermissions(item, objlist[0], objlist, remoteClient); | ||
536 | |||
535 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 537 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
536 | item.Description = asset.Description; | 538 | item.Description = asset.Description; |
537 | item.Name = asset.Name; | 539 | item.Name = asset.Name; |
538 | item.AssetType = asset.Type; | 540 | item.AssetType = asset.Type; |
539 | 541 | ||
540 | //preserve perms on return | ||
541 | if(DeRezAction.Return == action) | ||
542 | AddPermissions(item, objlist[0], objlist, null); | ||
543 | else | ||
544 | AddPermissions(item, objlist[0], objlist, remoteClient); | ||
545 | |||
546 | m_Scene.AddInventoryItem(item); | 542 | m_Scene.AddInventoryItem(item); |
547 | 543 | ||
548 | if (remoteClient != null && item.Owner == remoteClient.AgentId) | 544 | if (remoteClient != null && item.Owner == remoteClient.AgentId) |
@@ -599,15 +595,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
599 | } | 595 | } |
600 | effectivePerms |= (uint)PermissionMask.Move; | 596 | effectivePerms |= (uint)PermissionMask.Move; |
601 | 597 | ||
602 | //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); | ||
603 | |||
604 | if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) | 598 | if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) |
605 | { | 599 | { |
606 | // Changing ownership, so apply the "Next Owner" permissions to all of the | 600 | // Changing ownership, so apply the "Next Owner" permissions to all of the |
607 | // inventory item's permissions. | 601 | // inventory item's permissions. |
608 | 602 | ||
609 | uint perms = effectivePerms; | 603 | uint perms = effectivePerms; |
610 | PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms); | 604 | uint nextPerms = (perms & 7) << 13; |
605 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | ||
606 | perms &= ~(uint)PermissionMask.Copy; | ||
607 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | ||
608 | perms &= ~(uint)PermissionMask.Transfer; | ||
609 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | ||
610 | perms &= ~(uint)PermissionMask.Modify; | ||
611 | 611 | ||
612 | item.BasePermissions = perms & so.RootPart.NextOwnerMask; | 612 | item.BasePermissions = perms & so.RootPart.NextOwnerMask; |
613 | item.CurrentPermissions = item.BasePermissions; | 613 | item.CurrentPermissions = item.BasePermissions; |
@@ -640,10 +640,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
640 | (uint)PermissionMask.Move | | 640 | (uint)PermissionMask.Move | |
641 | (uint)PermissionMask.Export | | 641 | (uint)PermissionMask.Export | |
642 | 7); // Preserve folded permissions | 642 | 7); // Preserve folded permissions |
643 | } | 643 | } |
644 | 644 | ||
645 | //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); | ||
646 | |||
647 | return item; | 645 | return item; |
648 | } | 646 | } |
649 | 647 | ||
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index b7f01be..2837358 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -211,7 +211,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
211 | item.InvType = (int)InventoryType.Object; | 211 | item.InvType = (int)InventoryType.Object; |
212 | item.Folder = categoryID; | 212 | item.Folder = categoryID; |
213 | 213 | ||
214 | PermissionsUtil.ApplyFoldedPermissions(perms, ref perms); | 214 | uint nextPerms=(perms & 7) << 13; |
215 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | ||
216 | perms &= ~(uint)PermissionMask.Copy; | ||
217 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | ||
218 | perms &= ~(uint)PermissionMask.Transfer; | ||
219 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | ||
220 | perms &= ~(uint)PermissionMask.Modify; | ||
215 | 221 | ||
216 | item.BasePermissions = perms & part.NextOwnerMask; | 222 | item.BasePermissions = perms & part.NextOwnerMask; |
217 | item.CurrentPermissions = perms & part.NextOwnerMask; | 223 | item.CurrentPermissions = perms & part.NextOwnerMask; |