share before groupr roles was a testing elsewhere induced mistake, clean it up

httptests
UbitUmarov 2017-01-22 05:07:43 +00:00
parent 50e318c401
commit 8d99c86f96
1 changed files with 38 additions and 48 deletions

View File

@ -739,10 +739,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
} }
UUID taskGroupID = task.GroupID; UUID taskGroupID = task.GroupID;
bool groupdOwned = taskOwnerID == taskGroupID; bool notGroupdOwned = taskOwnerID != taskGroupID;
// if friends with rights then owner // if friends with rights then owner
if (!groupdOwned && IsFriendWithPerms(spID, taskOwnerID)) if (notGroupdOwned && IsFriendWithPerms(spID, taskOwnerID))
{ {
returnMask = ApplyObjectModifyMasks(grp.EffectiveOwnerPerms, objflags, unlocked); returnMask = ApplyObjectModifyMasks(grp.EffectiveOwnerPerms, objflags, unlocked);
returnMask |= EXTRAOWNERMASK; returnMask |= EXTRAOWNERMASK;
@ -756,10 +756,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions
ulong powers = 0; ulong powers = 0;
if(taskGroupID != UUID.Zero && GroupMemberPowers(taskGroupID, sp, ref powers)) if(taskGroupID != UUID.Zero && GroupMemberPowers(taskGroupID, sp, ref powers))
{ {
// shared as priority over group roles if(notGroupdOwned)
bool notShared = (grp.EffectiveGroupPerms & SHAREDMASK) == 0;
if(groupdOwned && notShared)
{ {
// group sharing or everyone
returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
if (taskOwnerID != UUID.Zero)
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
// object is owned by group, check role powers // object is owned by group, check role powers
if((powers & (ulong)GroupPowers.ObjectManipulate) == 0) if((powers & (ulong)GroupPowers.ObjectManipulate) == 0)
{ {
@ -778,26 +783,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
returnMask = ApplyObjectModifyMasks(grpEffectiveOwnerPerms, objflags, unlocked); returnMask = ApplyObjectModifyMasks(grpEffectiveOwnerPerms, objflags, unlocked);
returnMask |= returnMask |=
(uint)PrimFlags.ObjectGroupOwned | (uint)PrimFlags.ObjectGroupOwned |
(uint)PrimFlags.ObjectAnyOwner; (uint)PrimFlags.ObjectYouOwner;
if((returnMask & (uint)PrimFlags.ObjectModify) != 0) if((returnMask & (uint)PrimFlags.ObjectModify) != 0)
returnMask |= (uint)PrimFlags.ObjectOwnerModify; returnMask |= (uint)PrimFlags.ObjectOwnerModify;
return returnMask; return returnMask;
} }
else
{
// group sharing or everyone
returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
if(groupdOwned)
{
returnMask |=
(uint)PrimFlags.ObjectGroupOwned |
(uint)PrimFlags.ObjectAnyOwner;
}
else if (taskOwnerID != UUID.Zero)
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
}
// fallback is everyone rights // fallback is everyone rights
returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked); returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked);
@ -899,16 +889,16 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (group.IsAttachment) if (group.IsAttachment)
return 0; return 0;
if (IsFriendWithPerms(currentUser, objectOwner)) UUID sogGroupID = group.GroupID;
bool notgroudOwned = sogGroupID != objectOwner;
if (notgroudOwned && IsFriendWithPerms(currentUser, objectOwner))
return group.EffectiveOwnerPerms & lockmask; return group.EffectiveOwnerPerms & lockmask;
UUID sogGroupID = group.GroupID;
ulong powers = 0; ulong powers = 0;
if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, currentUser, ref powers)) if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, currentUser, ref powers))
{ {
bool Shared = (group.EffectiveGroupPerms & SHAREDMASK) != 0; if(notgroudOwned)
if(Shared || sogGroupID != objectOwner)
return group.EffectiveGroupOrEveryOnePerms & lockmask; return group.EffectiveGroupOrEveryOnePerms & lockmask;
if((powers & (ulong)GroupPowers.ObjectManipulate) == 0) if((powers & (ulong)GroupPowers.ObjectManipulate) == 0)
@ -955,16 +945,16 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (group.IsAttachment) if (group.IsAttachment)
return 0; return 0;
if (IsFriendWithPerms(spID, objectOwner)) UUID sogGroupID = group.GroupID;
bool notgroudOwned = sogGroupID != objectOwner;
if (notgroudOwned && IsFriendWithPerms(spID, objectOwner))
return group.EffectiveOwnerPerms & lockmask; return group.EffectiveOwnerPerms & lockmask;
UUID sogGroupID = group.GroupID;
ulong powers = 0; ulong powers = 0;
if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, sp, ref powers)) if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, sp, ref powers))
{ {
bool Shared = (group.EffectiveGroupPerms & SHAREDMASK) != 0; if(notgroudOwned)
if(Shared || sogGroupID != objectOwner)
return group.EffectiveGroupOrEveryOnePerms & lockmask; return group.EffectiveGroupOrEveryOnePerms & lockmask;
if((powers & (ulong)GroupPowers.ObjectManipulate) == 0) if((powers & (ulong)GroupPowers.ObjectManipulate) == 0)