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
parent
5655239f44
commit
24a0cc5261
|
@ -322,7 +322,7 @@ namespace OpenSim.Framework
|
||||||
l_EstateManagers.Remove(avatarID);
|
l_EstateManagers.Remove(avatarID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsEstateManager(UUID avatarID)
|
public bool IsEstateManagerOrOwner(UUID avatarID)
|
||||||
{
|
{
|
||||||
if (IsEstateOwner(avatarID))
|
if (IsEstateOwner(avatarID))
|
||||||
return true;
|
return true;
|
||||||
|
@ -368,7 +368,7 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
public bool HasAccess(UUID user)
|
public bool HasAccess(UUID user)
|
||||||
{
|
{
|
||||||
if (IsEstateManager(user))
|
if (IsEstateManagerOrOwner(user))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return l_EstateAccess.Contains(user);
|
return l_EstateAccess.Contains(user);
|
||||||
|
|
|
@ -227,10 +227,10 @@ namespace OpenSim.Framework.Tests
|
||||||
es.AddEstateManager(UUID.Zero);
|
es.AddEstateManager(UUID.Zero);
|
||||||
|
|
||||||
es.AddEstateManager(bannedUserId);
|
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);
|
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");
|
Assert.IsFalse(es.HasAccess(bannedUserId), "bannedUserID has access but shouldn't");
|
||||||
|
|
||||||
|
|
|
@ -967,7 +967,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||||
{
|
{
|
||||||
RegionHandshakeArgs args = new RegionHandshakeArgs();
|
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)
|
if (Scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero && Scene.RegionInfo.EstateSettings.EstateOwner == remoteClient.AgentId)
|
||||||
args.isEstateManager = true;
|
args.isEstateManager = true;
|
||||||
|
|
||||||
|
|
|
@ -469,7 +469,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
if (m_scene.Permissions.IsAdministrator(avatar))
|
if (m_scene.Permissions.IsAdministrator(avatar))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
|
if (m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(avatar))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (avatar == LandData.OwnerID)
|
if (avatar == LandData.OwnerID)
|
||||||
|
@ -499,7 +499,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
if (m_scene.Permissions.IsAdministrator(avatar))
|
if (m_scene.Permissions.IsAdministrator(avatar))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
|
if (m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(avatar))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (avatar == LandData.OwnerID)
|
if (avatar == LandData.OwnerID)
|
||||||
|
|
|
@ -503,7 +503,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||||
{
|
{
|
||||||
if (user == UUID.Zero) return false;
|
if (user == UUID.Zero) return false;
|
||||||
|
|
||||||
return m_scene.RegionInfo.EstateSettings.IsEstateManager(user);
|
return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -3832,7 +3832,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
land.LandData.UserLocation != Vector3.Zero &&
|
land.LandData.UserLocation != Vector3.Zero &&
|
||||||
land.LandData.OwnerID != m_uuid &&
|
land.LandData.OwnerID != m_uuid &&
|
||||||
(!m_scene.Permissions.IsGod(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);
|
float curr = Vector3.Distance(AbsolutePosition, pos);
|
||||||
if (Vector3.Distance(land.LandData.UserLocation, pos) < curr)
|
if (Vector3.Distance(land.LandData.UserLocation, pos) < curr)
|
||||||
|
@ -3852,7 +3852,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (GodLevel < 200 &&
|
if (GodLevel < 200 &&
|
||||||
((!m_scene.Permissions.IsGod(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 & TeleportFlags.ViaLocation) != 0 ||
|
||||||
(m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0))
|
(m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0))
|
||||||
{
|
{
|
||||||
|
@ -3920,7 +3920,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
GodLevel < 200 &&
|
GodLevel < 200 &&
|
||||||
((land.LandData.OwnerID != m_uuid &&
|
((land.LandData.OwnerID != m_uuid &&
|
||||||
!m_scene.Permissions.IsGod(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 & TeleportFlags.ViaLocation) != 0 ||
|
||||||
(m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0))
|
(m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0))
|
||||||
{
|
{
|
||||||
|
|
|
@ -10887,7 +10887,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
bool isAccount = false;
|
bool isAccount = false;
|
||||||
bool isGroup = 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;
|
return 0;
|
||||||
|
|
||||||
UUID id = new UUID();
|
UUID id = new UUID();
|
||||||
|
|
|
@ -449,7 +449,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
LSShoutError("LightShare functions are not enabled.");
|
LSShoutError("LightShare functions are not enabled.");
|
||||||
return 0;
|
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.");
|
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -477,7 +477,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
LSShoutError("LightShare functions are not enabled.");
|
LSShoutError("LightShare functions are not enabled.");
|
||||||
return;
|
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.");
|
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
|
||||||
return;
|
return;
|
||||||
|
@ -500,7 +500,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
LSShoutError("LightShare functions are not enabled.");
|
LSShoutError("LightShare functions are not enabled.");
|
||||||
return 0;
|
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.");
|
LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners.");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -369,7 +369,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_MANAGER"))
|
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_MANAGER"))
|
||||||
{
|
{
|
||||||
//Only Estate Managers may use the function
|
//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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue