From 0934e1cf71ee437829f47156af692bc59cf09947 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 12 Dec 2015 10:03:07 +0000 Subject: [PATCH] add IsEstateManager check to Permissions --- .../World/Permissions/PermissionsModule.cs | 1 + .../Framework/Scenes/Scene.Permissions.cs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 765c1f2978..2813acbb9b 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -271,6 +271,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnIsGod += IsGod; m_scene.Permissions.OnIsGridGod += IsGridGod; m_scene.Permissions.OnIsAdministrator += IsAdministrator; + m_scene.Permissions.OnIsEstateManager += IsEstateManager; m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; m_scene.Permissions.OnDeleteObject += CanDeleteObject; m_scene.Permissions.OnEditObject += CanEditObject; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 4d90726036..a901cfe933 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -69,6 +69,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool IsGodHandler(UUID user, Scene requestFromScene); public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene); public delegate bool IsAdministratorHandler(UUID user); + public delegate bool IsEstateManagerHandler(UUID user); public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager); public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); @@ -137,6 +138,7 @@ namespace OpenSim.Region.Framework.Scenes public event IsGodHandler OnIsGod; public event IsGridGodHandler OnIsGridGod; public event IsAdministratorHandler OnIsAdministrator; + public event IsEstateManagerHandler OnIsEstateManager; // public event EditParcelHandler OnEditParcel; public event EditParcelPropertiesHandler OnEditParcelProperties; public event SellParcelHandler OnSellParcel; @@ -761,6 +763,21 @@ namespace OpenSim.Region.Framework.Scenes } #endregion + public bool IsEstateManager(UUID user) + { + IsEstateManagerHandler handler = OnIsEstateManager; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (IsEstateManagerHandler h in list) + { + if (h(user) == false) + return false; + } + } + return true; + } + #region EDIT PARCEL public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, bool allowManager)