Prevent group deeded objects from being returned by the group return option

unless the user has that permission through the group.
0.6.6-post-fixes
Melanie Thielker 2009-05-24 17:29:40 +00:00
parent ca75c101ec
commit 4e64bf9360
1 changed files with 22 additions and 2 deletions

View File

@ -1551,8 +1551,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions
} }
break; break;
case (uint)ObjectReturnType.Group: case (uint)ObjectReturnType.Group:
if (parcel.landData.OwnerID != client.AgentId)
{
// If permissionis granted through a group...
//
if ((powers & (long)GroupPowers.ReturnGroupSet) != 0) if ((powers & (long)GroupPowers.ReturnGroupSet) != 0)
{
foreach (SceneObjectGroup g in new List<SceneObjectGroup>(retlist))
{
// check for and remove group owned objects unless
// the user also has permissions to return those
//
if (g.OwnerID == g.GroupID &&
((powers & (long)GroupPowers.ReturnGroupOwned) == 0))
{
retlist.Remove(g);
}
}
// And allow the operation
//
return true; return true;
}
}
break; break;
case (uint)ObjectReturnType.Other: case (uint)ObjectReturnType.Other:
if ((powers & (long)GroupPowers.ReturnNonGroup) != 0) if ((powers & (long)GroupPowers.ReturnNonGroup) != 0)