Fix a permissions issue
parent
af13c80d68
commit
cbb3a8ab94
|
@ -447,10 +447,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
|
||||
|
@ -466,10 +462,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.
|
||||
|
@ -477,6 +480,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;
|
||||
|
|
|
@ -280,7 +280,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;
|
||||
|
@ -294,12 +294,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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue