Fix a permissions issue

avinationmerge
Melanie Thielker 2010-07-14 16:21:55 +02:00
parent af13c80d68
commit cbb3a8ab94
2 changed files with 22 additions and 11 deletions

View File

@ -447,10 +447,6 @@ namespace OpenSim.Region.Framework.Scenes
(uint)PermissionMask.Move; (uint)PermissionMask.Move;
uint ownerPerms = item.CurrentPermissions; 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 // If this is an object, root prim perms may be more
// permissive than folded perms. Use folded perms as // permissive than folded perms. Use folded perms as
// a mask // a mask
@ -466,10 +462,17 @@ namespace OpenSim.Region.Framework.Scenes
// Mask the owner perms to the folded perms // Mask the owner perms to the folded perms
ownerPerms &= foldedPerms; ownerPerms &= foldedPerms;
basePerms &= foldedPerms;
// If the root was mod, let the mask reflect that // 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) if (isRootMod)
{
ownerPerms |= (uint)PermissionMask.Modify; ownerPerms |= (uint)PermissionMask.Modify;
basePerms |= (uint)PermissionMask.Modify;
}
} }
// These will be applied to the root prim at next rez. // 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 // are preserved due to the above mangling
ownerPerms &= nextPerms; 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 // Assign to the actual item. Make sure the slam bit is
// set, if it wasn't set before. // set, if it wasn't set before.
itemCopy.BasePermissions = basePerms; itemCopy.BasePermissions = basePerms;

View File

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