add IsEstateManager check to Permissions

LSLKeyTest
UbitUmarov 2015-12-12 10:03:07 +00:00
parent 5c39d9790e
commit 0934e1cf71
2 changed files with 18 additions and 0 deletions

View File

@ -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;

View File

@ -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)