refactor: Rename EstateSettings.IsEstateManager() to EstateSettings.IsEstateManagerOrOwner() to reflect what it actually does.

This makes it consistent with other parts of OpenSimulator that are treating ESTATE_MANAGER and ESTATE_OWNER as different entities.
As per opensim-dev mailing list.
0.7.4.1
Justin Clark-Casey (justincc) 2012-04-17 01:25:41 +01:00
parent 5655239f44
commit 24a0cc5261
9 changed files with 16 additions and 16 deletions

View File

@ -322,7 +322,7 @@ namespace OpenSim.Framework
l_EstateManagers.Remove(avatarID);
}
public bool IsEstateManager(UUID avatarID)
public bool IsEstateManagerOrOwner(UUID avatarID)
{
if (IsEstateOwner(avatarID))
return true;
@ -368,7 +368,7 @@ namespace OpenSim.Framework
public bool HasAccess(UUID user)
{
if (IsEstateManager(user))
if (IsEstateManagerOrOwner(user))
return true;
return l_EstateAccess.Contains(user);

View File

@ -227,10 +227,10 @@ namespace OpenSim.Framework.Tests
es.AddEstateManager(UUID.Zero);
es.AddEstateManager(bannedUserId);
Assert.IsTrue(es.IsEstateManager(bannedUserId), "bannedUserId should be EstateManager but isn't.");
Assert.IsTrue(es.IsEstateManagerOrOwner(bannedUserId), "bannedUserId should be EstateManager but isn't.");
es.RemoveEstateManager(bannedUserId);
Assert.IsFalse(es.IsEstateManager(bannedUserId), "bannedUserID is estateManager but shouldn't be");
Assert.IsFalse(es.IsEstateManagerOrOwner(bannedUserId), "bannedUserID is estateManager but shouldn't be");
Assert.IsFalse(es.HasAccess(bannedUserId), "bannedUserID has access but shouldn't");

View File

@ -967,7 +967,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
RegionHandshakeArgs args = new RegionHandshakeArgs();
args.isEstateManager = Scene.RegionInfo.EstateSettings.IsEstateManager(remoteClient.AgentId);
args.isEstateManager = Scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(remoteClient.AgentId);
if (Scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero && Scene.RegionInfo.EstateSettings.EstateOwner == remoteClient.AgentId)
args.isEstateManager = true;

View File

@ -469,7 +469,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
if (m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(avatar))
return false;
if (avatar == LandData.OwnerID)
@ -499,7 +499,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
if (m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(avatar))
return false;
if (avatar == LandData.OwnerID)

View File

@ -503,7 +503,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
{
if (user == UUID.Zero) return false;
return m_scene.RegionInfo.EstateSettings.IsEstateManager(user);
return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user);
}
#endregion

View File

@ -3832,7 +3832,7 @@ namespace OpenSim.Region.Framework.Scenes
land.LandData.UserLocation != Vector3.Zero &&
land.LandData.OwnerID != m_uuid &&
(!m_scene.Permissions.IsGod(m_uuid)) &&
(!m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid)))
(!m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)))
{
float curr = Vector3.Distance(AbsolutePosition, pos);
if (Vector3.Distance(land.LandData.UserLocation, pos) < curr)
@ -3852,7 +3852,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (GodLevel < 200 &&
((!m_scene.Permissions.IsGod(m_uuid) &&
!m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid)) ||
!m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) ||
(m_teleportFlags & TeleportFlags.ViaLocation) != 0 ||
(m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0))
{
@ -3920,7 +3920,7 @@ namespace OpenSim.Region.Framework.Scenes
GodLevel < 200 &&
((land.LandData.OwnerID != m_uuid &&
!m_scene.Permissions.IsGod(m_uuid) &&
!m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid)) ||
!m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) ||
(m_teleportFlags & TeleportFlags.ViaLocation) != 0 ||
(m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0))
{

View File

@ -10887,7 +10887,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
bool isAccount = false;
bool isGroup = false;
if (!estate.IsEstateOwner(m_host.OwnerID) || !estate.IsEstateManager(m_host.OwnerID))
if (!estate.IsEstateOwner(m_host.OwnerID) || !estate.IsEstateManagerOrOwner(m_host.OwnerID))
return 0;
UUID id = new UUID();

View File

@ -449,7 +449,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSShoutError("LightShare functions are not enabled.");
return 0;
}
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
{
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
return 0;
@ -477,7 +477,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSShoutError("LightShare functions are not enabled.");
return;
}
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
{
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
return;
@ -500,7 +500,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSShoutError("LightShare functions are not enabled.");
return 0;
}
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
{
LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners.");
return 0;

View File

@ -369,7 +369,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_MANAGER"))
{
//Only Estate Managers may use the function
if (World.RegionInfo.EstateSettings.IsEstateManager(ownerID) && World.RegionInfo.EstateSettings.EstateOwner != ownerID)
if (World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(ownerID) && World.RegionInfo.EstateSettings.EstateOwner != ownerID)
{
return;
}