From 85fcb4e75c94ff7b5b45609826df5113f32aacc0 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 2 Aug 2019 21:20:11 +1000 Subject: Another attempt at sorting out the auto group chicken and egg problems. Are you a local? Asking for a friend. --- .../ServiceConnectorsOut/Authorization/AuthorizationService.cs | 8 +++++--- .../Authorization/LocalAuthorizationServiceConnector.cs | 5 +++-- .../Authorization/RemoteAuthorizationServiceConnector.cs | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs index 2e06bc8..c910422 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs @@ -88,8 +88,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization } public bool IsAuthorizedForRegion( - string user, string firstName, string lastName, string regionID, out string message) + string user, string firstName, string lastName, string regionID, out string message, out bool isLocal) { + UUID userID = new UUID(user); + isLocal = m_UserManagement.IsLocalGridUser(userID); + // This should not happen if (m_Scene.RegionInfo.RegionID.ToString() != regionID) { @@ -105,11 +108,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization return true; } - UUID userID = new UUID(user); if ((m_accessValue & AccessFlags.DisallowForeigners) != 0) { - if (!m_UserManagement.IsLocalGridUser(userID)) + if (!isLocal) { message = "No foreign users allowed in this region"; return false; diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs index 0be0676..b2be907 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs @@ -114,13 +114,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization } public bool IsAuthorizedForRegion( - string userID, string firstName, string lastName, string regionID, out string message) + string userID, string firstName, string lastName, string regionID, out string message, out bool isLocal) { message = ""; + isLocal = false; if (!m_Enabled) return true; - return m_AuthorizationService.IsAuthorizedForRegion(userID, firstName, lastName, regionID, out message); + return m_AuthorizationService.IsAuthorizedForRegion(userID, firstName, lastName, regionID, out message, out isLocal); } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs index f312b0d..3df3288 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs @@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization } public bool IsAuthorizedForRegion( - string userID, string firstName, string lastName, string regionID, out string message) + string userID, string firstName, string lastName, string regionID, out string message, out bool isLocal) { m_log.InfoFormat( "[REMOTE AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} for region {1}", userID, regionID); @@ -141,6 +141,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization } } + isLocal = false; if (scene != null) { string mail = String.Empty; @@ -153,6 +154,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization mail = account.Email; firstName = account.FirstName; lastName = account.LastName; + isLocal = true; } isAuthorized -- cgit v1.1