From 281ad1251ced13931ddbf99671841ef87db6ec0a Mon Sep 17 00:00:00 2001 From: Rob Smart Date: Wed, 16 Sep 2009 13:34:14 +0100 Subject: updated the IAuthorizationService interface so that a message is passed back and can be displayed at the client when an avatar is denied access to a region --- .../Authorization/LocalAuthorizationServiceConnector.cs | 4 ++-- .../Authorization/RemoteAuthorizationServiceConnector.cs | 5 +++-- OpenSim/Region/Framework/Scenes/Scene.cs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs index c52c257..e69613a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs @@ -132,9 +132,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization } - public bool IsAuthorizedForRegion(string userID, string regionID) + public bool IsAuthorizedForRegion(string userID, string regionID, out string message) { - return m_AuthorizationService.IsAuthorizedForRegion(userID, regionID); + return m_AuthorizationService.IsAuthorizedForRegion(userID, regionID, out message); } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs index 9241851..a672f4f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs @@ -117,11 +117,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization } - public bool IsAuthorizedForRegion(string userID, string regionID) + public bool IsAuthorizedForRegion(string userID, string regionID, out string message) { m_log.InfoFormat("[REMOTE AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} for region {1}", userID, regionID); bool isAuthorized = true; + message = String.Empty; // get the scene this call is being made for Scene scene = null; @@ -140,7 +141,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization { UserProfileData profile = scene.CommsManager.UserService.GetUserProfile(new UUID(userID)); isAuthorized = IsAuthorizedForRegion(userID, profile.FirstName, profile.SurName, - profile.Email, scene.RegionInfo.RegionName, regionID); + profile.Email, scene.RegionInfo.RegionName, regionID, out message); } else { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0c2f991..80f3e4d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3253,10 +3253,11 @@ namespace OpenSim.Region.Framework.Scenes if (AuthorizationService != null) { - if (!AuthorizationService.IsAuthorizedForRegion(agent.AgentID.ToString(), RegionInfo.RegionID.ToString())) + if (!AuthorizationService.IsAuthorizedForRegion(agent.AgentID.ToString(), RegionInfo.RegionID.ToString(),out reason)) { m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region", agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); + //reason = String.Format("You are not currently on the access list for {0}",RegionInfo.RegionName); return false; } } -- cgit v1.1