rename sog.GetEffectivePermissions() since its use is now limited to more specific task, and no longer on current effective(full) path. Note that change ownermask start to be current ownermask, and filter it to all parts basemask

httptests
UbitUmarov 2017-05-01 14:18:59 +01:00
parent 2dbf96593c
commit 60dc124872
3 changed files with 13 additions and 25 deletions

View File

@ -580,25 +580,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export | PermissionMask.FoldedMask);
// For the porposes of inventory, an object is modify if the prims
// are modify. This allows renaming an object that contains no
// mod items.
foreach (SceneObjectGroup grp in objsForEffectivePermissions)
{
uint groupPerms = grp.GetEffectivePermissions(true);
// if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
// groupPerms |= (uint)PermissionMask.Modify;
effectivePerms &= groupPerms;
effectivePerms &= grp.CurrentAndFoldedNextPermissions();
}
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
{
// apply parts inventory items next owner
PermissionsUtil.ApplyNoModFoldedPermissions(effectivePerms, ref effectivePerms);
// change to next owner
uint basePerms = effectivePerms & so.RootPart.NextOwnerMask;
// rebuild folded perms since we don't have then on inworld objects
// fix and update folded
basePerms = PermissionsUtil.FixAndFoldPermissions(basePerms);
item.BasePermissions = basePerms;

View File

@ -206,12 +206,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
item.InvType = (int)InventoryType.Object;
item.Folder = categoryID;
perms = group.GetEffectivePermissions(false);
perms = group.CurrentAndFoldedNextPermissions();
// apply parts inventory next perms
PermissionsUtil.ApplyNoModFoldedPermissions(perms, ref perms);
// change to next owner perms
perms &= part.NextOwnerMask;
// update folded
perms = PermissionsUtil.FixAndFoldPermissions(perms);
item.BasePermissions = perms;

View File

@ -484,7 +484,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public uint GetEffectivePermissions(bool useBase)
public uint CurrentAndFoldedNextPermissions()
{
uint perms=(uint)(PermissionMask.Modify |
PermissionMask.Copy |
@ -492,18 +492,13 @@ namespace OpenSim.Region.Framework.Scenes
PermissionMask.Transfer |
PermissionMask.FoldedMask);
uint ownerMask = 0x7fffffff;
uint ownerMask = RootPart.OwnerMask;
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (useBase)
ownerMask &= part.BaseMask;
else
ownerMask &= part.OwnerMask;
ownerMask &= part.BaseMask;
perms &= part.Inventory.MaskEffectivePermissions();
}