permissions GenerateClientFlags() also needs group GetEffectivePermissions() for the everyone case. Current naive uncached GetEffectivePermissions() must be improved since its now a lot more used.
parent
e28ac282eb
commit
24d12dfba4
|
@ -631,7 +631,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
|
||||
#region Object Permissions
|
||||
#pragma warning disable 0612
|
||||
const uint DEFAULT_FLAGS = (uint)~(
|
||||
const uint DEFAULT_FLAGS = (uint)(
|
||||
PrimFlags.ObjectCopy | // Tells client you can copy the object
|
||||
PrimFlags.ObjectModify | // tells client you can modify the object
|
||||
PrimFlags.ObjectMove | // tells client that you can move the object (only, no mod)
|
||||
|
@ -701,6 +701,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
|
||||
bool unlocked = (task.ParentGroup.RootPart.OwnerMask & (uint)PermissionMask.Move) != 0;
|
||||
|
||||
uint effectivePerms;
|
||||
UUID taskOwnerID = task.OwnerID;
|
||||
UUID spID = sp.UUID;
|
||||
|
||||
|
@ -718,6 +719,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
if(task.ParentGroup.IsAttachment)
|
||||
{
|
||||
returnMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags, unlocked);
|
||||
effectivePerms = task.ParentGroup.GetEffectivePermissions();
|
||||
returnMask &= effectivePerms;
|
||||
if (taskOwnerID != UUID.Zero)
|
||||
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
|
||||
return returnMask;
|
||||
|
@ -726,6 +729,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
UUID taskGroupID = task.GroupID;
|
||||
bool groupdOwned = taskOwnerID == taskGroupID;
|
||||
|
||||
|
||||
// if friends with rights then owner
|
||||
if (!groupdOwned && IsFriendWithPerms(spID, taskOwnerID))
|
||||
{
|
||||
|
@ -753,9 +757,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
returnMask |= (uint)PrimFlags.ObjectOwnerModify;
|
||||
return returnMask;
|
||||
}
|
||||
else
|
||||
else if(task.GroupMask != 0)
|
||||
{
|
||||
// group sharing or everyone
|
||||
// group sharing
|
||||
returnMask = ApplyObjectModifyMasks(task.GroupMask | task.EveryoneMask, objflags, unlocked);
|
||||
returnMask |=
|
||||
(uint)PrimFlags.ObjectGroupOwned |
|
||||
|
@ -763,9 +767,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
return returnMask;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(task.GroupMask != 0)
|
||||
{
|
||||
// group sharing or everyone
|
||||
// group sharing
|
||||
returnMask = ApplyObjectModifyMasks(task.GroupMask | task.EveryoneMask, objflags, unlocked);
|
||||
if (taskOwnerID != UUID.Zero)
|
||||
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
|
||||
|
@ -774,7 +778,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
}
|
||||
|
||||
// fallback is everyone rights
|
||||
effectivePerms = task.ParentGroup.GetEffectivePermissions();
|
||||
returnMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags, unlocked);
|
||||
returnMask &= effectivePerms;
|
||||
if (taskOwnerID != UUID.Zero)
|
||||
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
|
||||
return returnMask;
|
||||
|
|
Loading…
Reference in New Issue