From 9c726fb178ce329e44fca9bca79a858f8a9ff4ae Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 9 Jun 2009 08:15:34 +0000 Subject: Thank you Snoopy, for a patch that implements group permissions. Applied with changes: - removed spammy debug message - corrected tab formatting --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6efcaa7..a2a7392 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1526,10 +1526,14 @@ namespace OpenSim.Region.Framework.Scenes return; if (part.OwnerID != remoteClient.AgentId) - return; - - if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) - return; + { + // Group permissions + if ( (part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0) ) + return; + } else { + if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) + return; + } if (!Permissions.CanCreateObjectInventory( itemBase.InvType, part.UUID, remoteClient.AgentId)) @@ -1598,13 +1602,18 @@ namespace OpenSim.Region.Framework.Scenes destId); return; } - + // Must own the object, and have modify rights if (srcPart.OwnerID != destPart.OwnerID) - return; - - if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) - return; + { + // Group permissions + if ( (destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) || + ((destPart.GroupMask & (uint)PermissionMask.Modify) == 0) ) + return; + } else { + if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) + return; + } if (destPart.ScriptAccessPin != pin) { -- cgit v1.1