aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs49
1 files changed, 28 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 2f016fa..afdd99e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -682,30 +682,26 @@ namespace OpenSim.Region.Framework.Scenes
682 // These will be applied to the root prim at next rez. 682 // These will be applied to the root prim at next rez.
683 // The legacy slam bit (bit 3) and folded permission (bits 0-2) 683 // The legacy slam bit (bit 3) and folded permission (bits 0-2)
684 // are preserved due to the above mangling 684 // are preserved due to the above mangling
685 ownerPerms &= nextPerms; 685// ownerPerms &= nextPerms;
686 686
687 // Mask the base permissions. This is a conservative 687 // Mask the base permissions. This is a conservative
688 // approach altering only the three main perms 688 // approach altering only the three main perms
689 basePerms &= nextPerms; 689// basePerms &= nextPerms;
690 690
691 // Mask out the folded portion of the base mask. 691 // Mask out the folded portion of the base mask.
692 // While the owner mask carries the actual folded 692 // While the owner mask carries the actual folded
693 // permissions, the base mask carries the original 693 // permissions, the base mask carries the original
694 // base mask, before masking with the folded perms. 694 // base mask, before masking with the folded perms.
695 // We need this later for rezzing. 695 // We need this later for rezzing.
696 basePerms &= ~(uint)PermissionMask.FoldedMask; 696// basePerms &= ~(uint)PermissionMask.FoldedMask;
697 basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0); 697// basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0);
698 698
699 // If this is an object, root prim perms may be more 699 // If this is an object, root prim perms may be more
700 // permissive than folded perms. Use folded perms as 700 // permissive than folded perms. Use folded perms as
701 // a mask 701 // a mask
702 if (item.InvType == (int)InventoryType.Object) 702 uint foldedPerms = (item.CurrentPermissions & (uint)PermissionMask.FoldedMask) << (int)PermissionMask.FoldingShift;
703 if (foldedPerms != 0 && item.InvType == (int)InventoryType.Object)
703 { 704 {
704 // Create a safe mask for the current perms
705 uint foldedPerms = (item.CurrentPermissions & 7) << 13;
706 if ((item.CurrentPermissions & (uint)PermissionMask.FoldedExport) != 0)
707 foldedPerms |= (uint)PermissionMask.Export;
708
709 foldedPerms |= permsMask; 705 foldedPerms |= permsMask;
710 706
711 bool isRootMod = (item.CurrentPermissions & 707 bool isRootMod = (item.CurrentPermissions &
@@ -729,6 +725,11 @@ namespace OpenSim.Region.Framework.Scenes
729 } 725 }
730 } 726 }
731 727
728 // move here so nextperms are mandatory
729 ownerPerms &= nextPerms;
730 basePerms &= nextPerms;
731 basePerms &= ~(uint)PermissionMask.FoldedMask;
732 basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0);
732 // Assign to the actual item. Make sure the slam bit is 733 // Assign to the actual item. Make sure the slam bit is
733 // set, if it wasn't set before. 734 // set, if it wasn't set before.
734 itemCopy.BasePermissions = basePerms; 735 itemCopy.BasePermissions = basePerms;
@@ -1266,20 +1267,26 @@ namespace OpenSim.Region.Framework.Scenes
1266 // 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
1267 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) 1268 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
1268 { 1269 {
1269 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1270 uint perms = taskItem.BasePermissions & taskItem.NextPermissions;
1270 if (taskItem.InvType == (int)InventoryType.Object) 1271 if (taskItem.InvType == (int)InventoryType.Object)
1271 agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move)); 1272 {
1273 PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms );
1274 perms = PermissionsUtil.FixAndFoldPermissions(perms);
1275 }
1272 else 1276 else
1273 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; 1277 perms &= taskItem.CurrentPermissions;
1274 1278
1275 agentItem.BasePermissions = agentItem.CurrentPermissions; 1279 // always unlock
1276 1280 perms |= (uint)PermissionMask.Move;
1281
1282 agentItem.BasePermissions = perms;
1283 agentItem.CurrentPermissions = perms;
1284 agentItem.NextPermissions = perms & taskItem.NextPermissions;
1285 agentItem.EveryOnePermissions = perms & taskItem.EveryonePermissions;
1286 agentItem.GroupPermissions = perms & taskItem.GroupPermissions;
1287
1277 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; 1288 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1278 agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); 1289 agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
1279 agentItem.NextPermissions = taskItem.NextPermissions;
1280 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
1281 // Group permissions make no sense here
1282 agentItem.GroupPermissions = 0;
1283 } 1290 }
1284 else 1291 else
1285 { 1292 {
@@ -1287,7 +1294,7 @@ namespace OpenSim.Region.Framework.Scenes
1287 agentItem.CurrentPermissions = taskItem.CurrentPermissions; 1294 agentItem.CurrentPermissions = taskItem.CurrentPermissions;
1288 agentItem.NextPermissions = taskItem.NextPermissions; 1295 agentItem.NextPermissions = taskItem.NextPermissions;
1289 agentItem.EveryOnePermissions = taskItem.EveryonePermissions; 1296 agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
1290 agentItem.GroupPermissions = 0; 1297 agentItem.GroupPermissions = taskItem.GroupPermissions;
1291 } 1298 }
1292 1299
1293 message = null; 1300 message = null;