Allow gods and estate managers/owners to be unaffected by parcel bans

avinationmerge
Melanie Thielker 2010-07-29 16:33:20 +02:00
parent 516ec4acd0
commit 7871dd606e
3 changed files with 24 additions and 0 deletions

View File

@ -283,6 +283,9 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsBannedFromLand(UUID avatar) public bool IsBannedFromLand(UUID avatar)
{ {
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0)
{ {
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
@ -301,6 +304,9 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsRestrictedFromLand(UUID avatar) public bool IsRestrictedFromLand(UUID avatar)
{ {
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
{ {
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();

View File

@ -209,6 +209,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.Permissions.OnDeedParcel += CanDeedParcel; m_scene.Permissions.OnDeedParcel += CanDeedParcel;
m_scene.Permissions.OnDeedObject += CanDeedObject; m_scene.Permissions.OnDeedObject += CanDeedObject;
m_scene.Permissions.OnIsGod += IsGod; m_scene.Permissions.OnIsGod += IsGod;
m_scene.Permissions.OnIsAdministrator += IsAdministrator;
m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED

View File

@ -64,6 +64,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene);
public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand);
public delegate bool IsGodHandler(UUID user, Scene requestFromScene); public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
public delegate bool IsAdministratorHandler(UUID user);
public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
@ -122,6 +123,7 @@ namespace OpenSim.Region.Framework.Scenes
public event RunConsoleCommandHandler OnRunConsoleCommand; public event RunConsoleCommandHandler OnRunConsoleCommand;
public event IssueEstateCommandHandler OnIssueEstateCommand; public event IssueEstateCommandHandler OnIssueEstateCommand;
public event IsGodHandler OnIsGod; public event IsGodHandler OnIsGod;
public event IsAdministratorHandler OnIsAdministrator;
public event EditParcelHandler OnEditParcel; public event EditParcelHandler OnEditParcel;
public event SellParcelHandler OnSellParcel; public event SellParcelHandler OnSellParcel;
public event AbandonParcelHandler OnAbandonParcel; public event AbandonParcelHandler OnAbandonParcel;
@ -652,6 +654,21 @@ namespace OpenSim.Region.Framework.Scenes
} }
return true; return true;
} }
public bool IsAdministrator(UUID user)
{
IsAdministratorHandler handler = OnIsAdministrator;
if (handler != null)
{
Delegate[] list = handler.GetInvocationList();
foreach (IsAdministratorHandler h in list)
{
if (h(user) == false)
return false;
}
}
return true;
}
#endregion #endregion
#region EDIT PARCEL #region EDIT PARCEL