aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs44
1 files changed, 23 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 60f730d..96f22a4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -382,29 +382,31 @@ namespace OpenSim.Region.Framework.Scenes
382 itemCopy.InvType = item.InvType; 382 itemCopy.InvType = item.InvType;
383 itemCopy.Folder = recipientFolderId; 383 itemCopy.Folder = recipientFolderId;
384 384
385 if (Permissions.PropagatePermissions()) 385 if (Permissions.PropagatePermissions() && recipient != senderId)
386 { 386 {
387 // First, make sore base is limited to the next perms
388 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
389 // By default, current equals base
390 itemCopy.CurrentPermissions = itemCopy.BasePermissions;
391
392 // If this is an object, replace current perms
393 // with folded perms
387 if (item.InvType == (int)InventoryType.Object) 394 if (item.InvType == (int)InventoryType.Object)
388 { 395 {
389 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); 396 itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
390 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; 397 itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13;
391 }
392 else
393 {
394 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
395 } 398 }
396 399
397 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 400 // Ensure there is no escalation
398 if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit 401 itemCopy.CurrentPermissions &= item.NextPermissions;
399 { 402
400 itemCopy.BasePermissions &= item.NextPermissions; 403 // Need slam bit on xfer
401 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 404 itemCopy.CurrentPermissions |= 8;
402 itemCopy.CurrentPermissions |= 8;
403 }
404 405
405 itemCopy.NextPermissions = item.NextPermissions; 406 itemCopy.NextPermissions = item.NextPermissions;
406 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; 407
407 itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; 408 itemCopy.EveryOnePermissions = 0;
409 itemCopy.GroupPermissions = 0;
408 } 410 }
409 else 411 else
410 { 412 {
@@ -895,12 +897,12 @@ namespace OpenSim.Region.Framework.Scenes
895 897
896 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) 898 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
897 { 899 {
900 agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
898 if (taskItem.InvType == (int)InventoryType.Object) 901 if (taskItem.InvType == (int)InventoryType.Object)
899 agentItem.BasePermissions = taskItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); 902 agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13);
900 else 903 agentItem.CurrentPermissions = agentItem.BasePermissions ;
901 agentItem.BasePermissions = taskItem.BasePermissions; 904
902 agentItem.BasePermissions &= taskItem.NextPermissions; 905 agentItem.CurrentPermissions |= 8;
903 agentItem.CurrentPermissions = agentItem.BasePermissions | 8;
904 agentItem.NextPermissions = taskItem.NextPermissions; 906 agentItem.NextPermissions = taskItem.NextPermissions;
905 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; 907 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
906 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 908 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;