Fix more perms weirdness. Preserve "Locked" status across gives and rez/take.

Preserve "Anyone can move" flag in most cases.
avinationmerge
Melanie 2010-06-27 20:20:08 +01:00
parent ba38c697e8
commit 9c553cd254
1 changed files with 9 additions and 8 deletions

View File

@ -402,7 +402,7 @@ namespace OpenSim.Region.Framework.Scenes
// First, make sore base is limited to the next perms // First, make sore base is limited to the next perms
itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move); itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
// By default, current equals base // By default, current equals base
itemCopy.CurrentPermissions = itemCopy.BasePermissions; itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions;
// If this is an object, replace current perms // If this is an object, replace current perms
// with folded perms // with folded perms
@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
// Ensure there is no escalation // Ensure there is no escalation
itemCopy.CurrentPermissions &= item.NextPermissions; itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move);
// Need slam bit on xfer // Need slam bit on xfer
itemCopy.CurrentPermissions |= 8; itemCopy.CurrentPermissions |= 8;
@ -918,12 +918,13 @@ namespace OpenSim.Region.Framework.Scenes
{ {
agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
if (taskItem.InvType == (int)InventoryType.Object) if (taskItem.InvType == (int)InventoryType.Object)
agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
agentItem.CurrentPermissions = agentItem.BasePermissions ; else
agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
agentItem.CurrentPermissions |= 8; agentItem.CurrentPermissions |= 8;
agentItem.NextPermissions = taskItem.NextPermissions; agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
} }
else else
@ -1105,11 +1106,11 @@ namespace OpenSim.Region.Framework.Scenes
if (Permissions.PropagatePermissions()) if (Permissions.PropagatePermissions())
{ {
destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
srcTaskItem.NextPermissions; (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions & destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
srcTaskItem.NextPermissions; (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions & destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
srcTaskItem.NextPermissions; (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.BasePermissions = srcTaskItem.BasePermissions & destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
(srcTaskItem.NextPermissions | (uint)PermissionMask.Move); (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.CurrentPermissions |= 8; // Slam! destTaskItem.CurrentPermissions |= 8; // Slam!