From c028d0a3c10024efcac1272d569e2b6e5e4d0176 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 24 May 2009 16:55:34 +0000 Subject: Make group permissions control what a user can return. --- .../World/Permissions/PermissionsModule.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 6beb6d3..33b9288 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1530,6 +1530,38 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; + long powers = 0; + if (parcel.landData.GroupID != UUID.Zero) + client.GetGroupPowers(parcel.landData.GroupID); + + switch (type) + { + case (uint)ObjectReturnType.Owner: + // Don't let group members return owner's objects, ever + // + if (parcel.landData.IsGroupOwned) + { + if ((powers & (long)GroupPowers.ReturnGroupOwned) != 0) + return true; + } + else + { + if (parcel.landData.OwnerID != client.AgentId) + return false; + } + break; + case (uint)ObjectReturnType.Group: + if ((powers & (long)GroupPowers.ReturnGroupSet) != 0) + return true; + break; + case (uint)ObjectReturnType.Other: + if ((powers & (long)GroupPowers.ReturnNonGroup) != 0) + return true; + break; + case (uint)ObjectReturnType.List: + break; + } + return GenericParcelPermission(client.AgentId, parcel); } } -- cgit v1.1