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

Preserve "Anyone can move" flag in most cases.
prebuild-update
Melanie 2010-06-27 20:20:08 +01:00
parent 121ba7e95c
commit 3612a5252b
1 changed files with 9 additions and 8 deletions

View File

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