Fix a permissions issue

prebuild-update
Melanie Thielker 2010-07-14 16:21:55 +02:00 committed by Melanie
parent 33aa7ba7dc
commit 39cd57598b
2 changed files with 22 additions and 11 deletions

View File

@ -432,10 +432,6 @@ namespace OpenSim.Region.Framework.Scenes
(uint)PermissionMask.Move;
uint ownerPerms = item.CurrentPermissions;
// Mask the base permissions. This is a conservative
// approach altering only the three main perms
basePerms &= nextPerms;
// If this is an object, root prim perms may be more
// permissive than folded perms. Use folded perms as
// a mask
@ -451,10 +447,17 @@ namespace OpenSim.Region.Framework.Scenes
// Mask the owner perms to the folded perms
ownerPerms &= foldedPerms;
basePerms &= foldedPerms;
// If the root was mod, let the mask reflect that
// We also need to adjust the base here, because
// we should be able to edit in-inventory perms
// for the root prim, if it's mod.
if (isRootMod)
{
ownerPerms |= (uint)PermissionMask.Modify;
basePerms |= (uint)PermissionMask.Modify;
}
}
// These will be applied to the root prim at next rez.
@ -462,6 +465,10 @@ namespace OpenSim.Region.Framework.Scenes
// are preserved due to the above mangling
ownerPerms &= nextPerms;
// Mask the base permissions. This is a conservative
// approach altering only the three main perms
basePerms &= nextPerms;
// Assign to the actual item. Make sure the slam bit is
// set, if it wasn't set before.
itemCopy.BasePermissions = basePerms;

View File

@ -282,7 +282,7 @@ namespace OpenSim.Region.Framework.Scenes
PermissionMask.Move |
PermissionMask.Transfer) | 7;
uint ownerMask = 0x7ffffff;
uint ownerMask = 0x7fffffff;
foreach (SceneObjectPart part in m_parts.Values)
{
ownerMask &= part.OwnerMask;
@ -296,12 +296,16 @@ namespace OpenSim.Region.Framework.Scenes
if ((ownerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
perms &= ~((uint)PermissionMask.Modify >> 13);
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
perms &= ~((uint)PermissionMask.Copy >> 13);
if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~((uint)PermissionMask.Transfer >> 13);
// If root prim permissions are applied here, this would screw
// with in-inventory manipulation of the next owner perms
// in a major way. So, let's move this to the give itself.
// Yes. I know. Evil.
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
// perms &= ~((uint)PermissionMask.Modify >> 13);
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
// perms &= ~((uint)PermissionMask.Copy >> 13);
// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
// perms &= ~((uint)PermissionMask.Transfer >> 13);
return perms;
}