From 9622e8ac72d29b75b96d2dd481671b57d0a204bf Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 23 Apr 2012 19:20:46 +0300 Subject: If a Grid God teleports then include the Godlike teleport flag. This can affect the starting position in the destination region. --- .../World/Permissions/PermissionsModule.cs | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 2032905..7d75fad 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -166,6 +166,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnDeedParcel += CanDeedParcel; m_scene.Permissions.OnDeedObject += CanDeedObject; m_scene.Permissions.OnIsGod += IsGod; + m_scene.Permissions.OnIsGridGod += IsGridGod; m_scene.Permissions.OnIsAdministrator += IsAdministrator; m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED @@ -466,22 +467,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (IsEstateManager(user) && m_RegionManagerIsGod) return true; + if (IsGridGod(user, null)) + return true; + + return false; + } + + /// + /// Is the given user a God throughout the grid (not just in the current scene)? + /// + /// The user + /// Unused, can be null + /// + protected bool IsGridGod(UUID user, Scene scene) + { + DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); + if (m_bypassPermissions) return m_bypassPermissionsValue; + + if (user == UUID.Zero) return false; + if (m_allowGridGods) { ScenePresence sp = m_scene.GetScenePresence(user); if (sp != null) - { - if (sp.UserLevel >= 200) - return true; - return false; - } + return (sp.UserLevel >= 200); UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); if (account != null) - { - if (account.UserLevel >= 200) - return true; - } + return (account.UserLevel >= 200); } return false; -- cgit v1.1