From d62aed7f468d50a3b1f9ee678be9ba66d77a9218 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 3 May 2017 21:12:16 +0100 Subject: fix right to change permissions of group owned objects --- .../World/Permissions/PermissionsModule.cs | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/World/Permissions') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 4c4a8a5..45c1c56 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -293,6 +293,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions scenePermissions.OnDeleteObject += CanDeleteObject; scenePermissions.OnEditObjectByIDs += CanEditObjectByIDs; scenePermissions.OnEditObject += CanEditObject; + scenePermissions.OnEditObjectPerms += CanEditObjectPerms; scenePermissions.OnInventoryTransfer += CanInventoryTransfer; scenePermissions.OnMoveObject += CanMoveObject; scenePermissions.OnTakeObject += CanTakeObject; @@ -391,6 +392,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions scenePermissions.OnDeleteObject -= CanDeleteObject; scenePermissions.OnEditObjectByIDs -= CanEditObjectByIDs; scenePermissions.OnEditObject -= CanEditObject; + scenePermissions.OnEditObjectPerms -= CanEditObjectPerms; scenePermissions.OnInventoryTransfer -= CanInventoryTransfer; scenePermissions.OnMoveObject -= CanMoveObject; scenePermissions.OnTakeObject -= CanTakeObject; @@ -1387,6 +1389,35 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; } + private bool CanEditObjectPerms(SceneObjectGroup sog, UUID userID) + { + DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); + if (m_bypassPermissions) return m_bypassPermissionsValue; + + if (sog == null) + return false; + + if(sog.OwnerID == userID || IsAdministrator(userID)) + return true; + + UUID sogGroupID = sog.GroupID; + if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID) + return false; + + uint perms = sog.EffectiveOwnerPerms; + if((perms & (uint)PermissionMask.Modify) == 0) + return false; + + ulong powers = 0; + if(GroupMemberPowers(sogGroupID, userID, ref powers)) + { + if((powers & (ulong)GroupPowers.ObjectManipulate) != 0) + return true; + } + + return false; + } + private bool CanEditObjectInventory(UUID objectID, UUID userID) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); @@ -2306,7 +2337,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions ulong powers = 0; if(GroupMemberPowers(sogGroupID, userID, ref powers)) { - if(powers == (ulong)GroupPowers.ObjectManipulate) + if((powers & (ulong)GroupPowers.ObjectManipulate) != 0) return true; if((ti.EveryonePermissions & (uint)PermissionMask.Copy) != 0) -- cgit v1.1