From c2f1771c63108c78b799a4f107cabe7e33984866 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 14 Aug 2008 18:08:22 +0000 Subject: Make the estate owner work. Changes permissions checks to allow the estate owner user the ability to add and remove estate managers, and have EM rights outside of that. --- .../Modules/World/Estate/EstateManagementModule.cs | 12 ++++-------- .../Modules/World/Permissions/PermissionsModule.cs | 8 +++++++- OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | 6 +++--- 3 files changed, 14 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 1be587a..d22aac6 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -218,7 +218,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate switch (estateAccessType) { case 64: - if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) + if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; @@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate } break; case 128: - if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) + if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; @@ -303,9 +303,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate break; case 256: - // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml - // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates - if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) + if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, true) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { m_scene.RegionInfo.EstateSettings.AddEstateManager(user); m_scene.RegionInfo.EstateSettings.Save(); @@ -318,9 +316,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate break; case 512: - // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml - // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates - if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) + if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, true) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); m_scene.RegionInfo.EstateSettings.Save(); diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 0dfcb44..25ea282 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -626,11 +626,17 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericCommunicationPermission(user, target); } - private bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene) + private bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; + if (m_scene.RegionInfo.EstateSettings.IsEstateOwner(user)) + return true; + + if (ownerCommand) + return false; + return GenericEstatePermission(user); } diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index c7d1ce2..0b2cc9e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs @@ -761,7 +761,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region CAN ISSUE ESTATE COMMAND - public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene); + public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); private List CanIssueEstateCommandCheckFunctions = new List(); public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) @@ -775,11 +775,11 @@ namespace OpenSim.Region.Environment.Scenes CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanIssueEstateCommand(LLUUID user) + public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) { foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) { - if (check(user, m_scene) == false) + if (check(user, m_scene, ownerCommand) == false) { return false; } -- cgit v1.1