Change the way the object perms are propagated to attempt to salvage

some older content
avinationmerge
Melanie 2010-05-21 02:31:14 +01:00
parent f77f9ecd8f
commit 147c2d6f80
1 changed files with 23 additions and 21 deletions

View File

@ -437,29 +437,31 @@ namespace OpenSim.Region.Framework.Scenes
itemCopy.InvType = item.InvType; itemCopy.InvType = item.InvType;
itemCopy.Folder = recipientFolderId; itemCopy.Folder = recipientFolderId;
if (Permissions.PropagatePermissions()) if (Permissions.PropagatePermissions() && recipient != senderId)
{ {
// First, make sore base is limited to the next perms
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
// By default, current equals base
itemCopy.CurrentPermissions = itemCopy.BasePermissions;
// If this is an object, replace current perms
// with folded perms
if (item.InvType == (int)InventoryType.Object) if (item.InvType == (int)InventoryType.Object)
{ {
itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13;
}
else
{
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
} }
itemCopy.CurrentPermissions = itemCopy.BasePermissions; // Ensure there is no escalation
if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit itemCopy.CurrentPermissions &= item.NextPermissions;
{
itemCopy.BasePermissions &= item.NextPermissions; // Need slam bit on xfer
itemCopy.CurrentPermissions = itemCopy.BasePermissions;
itemCopy.CurrentPermissions |= 8; itemCopy.CurrentPermissions |= 8;
}
itemCopy.NextPermissions = item.NextPermissions; itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; itemCopy.EveryOnePermissions = 0;
itemCopy.GroupPermissions = 0;
} }
else else
{ {
@ -913,12 +915,12 @@ namespace OpenSim.Region.Framework.Scenes
if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
{ {
agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
if (taskItem.InvType == (int)InventoryType.Object) if (taskItem.InvType == (int)InventoryType.Object)
agentItem.BasePermissions = taskItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13);
else agentItem.CurrentPermissions = agentItem.BasePermissions ;
agentItem.BasePermissions = taskItem.BasePermissions;
agentItem.BasePermissions &= taskItem.NextPermissions; agentItem.CurrentPermissions |= 8;
agentItem.CurrentPermissions = agentItem.BasePermissions | 8;
agentItem.NextPermissions = taskItem.NextPermissions; agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;