aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-05-21 02:31:14 +0100
committerMelanie2010-05-21 15:57:16 +0100
commit59546a348a4a47e21c5d05e53e1a2b15da10ce7a (patch)
tree5876b6120ca855f51dc59ddf60f04564ee0d5da2 /OpenSim
parentminor: correctly print out missing item id when it can't be found rather than... (diff)
downloadopensim-SC-59546a348a4a47e21c5d05e53e1a2b15da10ce7a.zip
opensim-SC-59546a348a4a47e21c5d05e53e1a2b15da10ce7a.tar.gz
opensim-SC-59546a348a4a47e21c5d05e53e1a2b15da10ce7a.tar.bz2
opensim-SC-59546a348a4a47e21c5d05e53e1a2b15da10ce7a.tar.xz
Change the way the object perms are propagated to attempt to salvage
some older content
Diffstat (limited to 'OpenSim')
-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 fcbeeb6..af5742c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -438,29 +438,31 @@ namespace OpenSim.Region.Framework.Scenes
438 itemCopy.InvType = item.InvType; 438 itemCopy.InvType = item.InvType;
439 itemCopy.Folder = recipientFolderId; 439 itemCopy.Folder = recipientFolderId;
440 440
441 if (Permissions.PropagatePermissions()) 441 if (Permissions.PropagatePermissions() && recipient != senderId)
442 { 442 {
443 // First, make sore base is limited to the next perms
444 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
445 // By default, current equals base
446 itemCopy.CurrentPermissions = itemCopy.BasePermissions;
447
448 // If this is an object, replace current perms
449 // with folded perms
443 if (item.InvType == (int)InventoryType.Object) 450 if (item.InvType == (int)InventoryType.Object)
444 { 451 {
445 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); 452 itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
446 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; 453 itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13;
447 }
448 else
449 {
450 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
451 } 454 }
452 455
453 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 456 // Ensure there is no escalation
454 if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit 457 itemCopy.CurrentPermissions &= item.NextPermissions;
455 { 458
456 itemCopy.BasePermissions &= item.NextPermissions; 459 // Need slam bit on xfer
457 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 460 itemCopy.CurrentPermissions |= 8;
458 itemCopy.CurrentPermissions |= 8;
459 }
460 461
461 itemCopy.NextPermissions = item.NextPermissions; 462 itemCopy.NextPermissions = item.NextPermissions;
462 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; 463
463 itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; 464 itemCopy.EveryOnePermissions = 0;
465 itemCopy.GroupPermissions = 0;
464 } 466 }
465 else 467 else
466 { 468 {
@@ -909,12 +911,12 @@ namespace OpenSim.Region.Framework.Scenes
909 911
910 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) 912 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
911 { 913 {
914 agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
912 if (taskItem.InvType == (int)InventoryType.Object) 915 if (taskItem.InvType == (int)InventoryType.Object)
913 agentItem.BasePermissions = taskItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); 916 agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13);
914 else 917 agentItem.CurrentPermissions = agentItem.BasePermissions ;
915 agentItem.BasePermissions = taskItem.BasePermissions; 918
916 agentItem.BasePermissions &= taskItem.NextPermissions; 919 agentItem.CurrentPermissions |= 8;
917 agentItem.CurrentPermissions = agentItem.BasePermissions | 8;
918 agentItem.NextPermissions = taskItem.NextPermissions; 920 agentItem.NextPermissions = taskItem.NextPermissions;
919 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; 921 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
920 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 922 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;