From 984345a2022ba805869990e0c495af08ffe40ce9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 19 Jan 2017 13:10:04 +0000 Subject: add CanEdit check for SOGs, iclients and SPs that need to be in scene and use it --- .../CoreModules/World/Permissions/PermissionsModule.cs | 17 ++++++++++++++++- 1 file changed, 16 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 4f62827..1c8d4b8 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -283,6 +283,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnIsEstateManager += IsEstateManager; m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; m_scene.Permissions.OnDeleteObject += CanDeleteObject; + m_scene.Permissions.OnEditObjectByIDs += CanEditObjectByIDs; m_scene.Permissions.OnEditObject += CanEditObject; m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; m_scene.Permissions.OnInstantMessage += CanInstantMessage; @@ -1235,7 +1236,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; } - private bool CanEditObject(UUID objectID, UUID userID, Scene scene) + private bool CanEditObjectByIDs(UUID objectID, UUID userID, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -1250,6 +1251,20 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; } + private bool CanEditObject(SceneObjectGroup sog, ScenePresence sp) + { + DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); + if (m_bypassPermissions) return m_bypassPermissionsValue; + + if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted) + return false; + + uint perms = GetObjectPermissions(sp, sog, true); + if((perms & (uint)PermissionMask.Modify) == 0) + return false; + return true; + } + private bool CanEditObjectInventory(UUID objectID, UUID userID, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); -- cgit v1.1