diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 44 |
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 e031ebc..ba70ae5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -437,29 +437,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
437 | itemCopy.InvType = item.InvType; | 437 | itemCopy.InvType = item.InvType; |
438 | itemCopy.Folder = recipientFolderId; | 438 | itemCopy.Folder = recipientFolderId; |
439 | 439 | ||
440 | if (Permissions.PropagatePermissions()) | 440 | if (Permissions.PropagatePermissions() && recipient != senderId) |
441 | { | 441 | { |
442 | // First, make sore base is limited to the next perms | ||
443 | itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; | ||
444 | // By default, current equals base | ||
445 | itemCopy.CurrentPermissions = itemCopy.BasePermissions; | ||
446 | |||
447 | // If this is an object, replace current perms | ||
448 | // with folded perms | ||
442 | if (item.InvType == (int)InventoryType.Object) | 449 | if (item.InvType == (int)InventoryType.Object) |
443 | { | 450 | { |
444 | itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); | 451 | itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); |
445 | itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; | 452 | itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13; |
446 | } | ||
447 | else | ||
448 | { | ||
449 | itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; | ||
450 | } | 453 | } |
451 | 454 | ||
452 | itemCopy.CurrentPermissions = itemCopy.BasePermissions; | 455 | // Ensure there is no escalation |
453 | if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit | 456 | itemCopy.CurrentPermissions &= item.NextPermissions; |
454 | { | 457 | |
455 | itemCopy.BasePermissions &= item.NextPermissions; | 458 | // Need slam bit on xfer |
456 | itemCopy.CurrentPermissions = itemCopy.BasePermissions; | 459 | itemCopy.CurrentPermissions |= 8; |
457 | itemCopy.CurrentPermissions |= 8; | ||
458 | } | ||
459 | 460 | ||
460 | itemCopy.NextPermissions = item.NextPermissions; | 461 | itemCopy.NextPermissions = item.NextPermissions; |
461 | itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; | 462 | |
462 | itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; | 463 | itemCopy.EveryOnePermissions = 0; |
464 | itemCopy.GroupPermissions = 0; | ||
463 | } | 465 | } |
464 | else | 466 | else |
465 | { | 467 | { |
@@ -913,12 +915,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
913 | 915 | ||
914 | if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) | 916 | if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) |
915 | { | 917 | { |
918 | agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions; | ||
916 | if (taskItem.InvType == (int)InventoryType.Object) | 919 | if (taskItem.InvType == (int)InventoryType.Object) |
917 | agentItem.BasePermissions = taskItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); | 920 | agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); |
918 | else | 921 | agentItem.CurrentPermissions = agentItem.BasePermissions ; |
919 | agentItem.BasePermissions = taskItem.BasePermissions; | 922 | |
920 | agentItem.BasePermissions &= taskItem.NextPermissions; | 923 | agentItem.CurrentPermissions |= 8; |
921 | agentItem.CurrentPermissions = agentItem.BasePermissions | 8; | ||
922 | agentItem.NextPermissions = taskItem.NextPermissions; | 924 | agentItem.NextPermissions = taskItem.NextPermissions; |
923 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; | 925 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; |
924 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; | 926 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; |