From a4efa939932f823af2affe0e97446a8d807004e0 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 14 May 2008 23:25:07 +0000 Subject: * Comitting 0001271: [PATCH] Refactor permissions to fully allow stacking permissions modules. From Melanie. Thanks Melanie! --- .../Modules/World/Estate/EstateManagementModule.cs | 6 ++--- .../Modules/World/Permissions/PermissionsModule.cs | 29 ++++++++++------------ 2 files changed, 16 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 098175b..fcdec5d 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate // 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.Permissions.BypassPermissions) + if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { m_scene.RegionInfo.EstateSettings.AddEstateManager(user); remote_client.sendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.estateManagers, m_scene.RegionInfo.EstateSettings.estateID); @@ -219,7 +219,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate 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.Permissions.BypassPermissions) + if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); remote_client.sendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.estateManagers, m_scene.RegionInfo.EstateSettings.estateID); @@ -438,4 +438,4 @@ namespace OpenSim.Region.Environment.Modules.World.Estate sendRegionHandshake(client); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index bd21ca7..76f21f7 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -63,23 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions private bool m_bypassPermissions = false; private bool m_bypassPermissionsValue = true; private bool m_debugPermissions = false; - public bool BypassPermissions - { - get { return m_bypassPermissions; } - set { m_bypassPermissions = value; } - } - - public bool BypassPermissionsValue - { - get { return m_bypassPermissionsValue; } - set { m_bypassPermissionsValue = value; } - } - public bool DebugPermissions - { - get { return m_debugPermissions; } - set { m_debugPermissions = value; } - } #endregion #region ICommandableModule Members @@ -157,7 +141,10 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions m_scene.RegisterModuleInterface(this); //Register functions with Scene External Checks! + m_scene.ExternalChecks.addBypassPermissions(BypassPermissions); //FULLY IMPLEMENTED + m_scene.ExternalChecks.addSetBypassPermissions(SetBypassPermissions); //FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckAbandonParcel(CanAbandonParcel); //FULLY IMPLEMENTED + m_scene.ExternalChecks.addGenerateClientFlags(GenerateClientFlags); //NOT YET FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckBeGodLike(CanBeGodLike); //FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckDuplicateObject(CanDuplicateObject); //FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckDeleteObject(CanDeleteObject); //MAYBE FULLY IMPLEMENTED @@ -260,6 +247,16 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions } #endregion + public bool BypassPermissions() + { + return m_bypassPermissions; + } + + public void SetBypassPermissions(bool value) + { + m_bypassPermissions=value; + } + #region Object Permissions public uint GenerateClientFlags(LLUUID user, LLUUID objID) -- cgit v1.1