From 16940097beee0fad554dfcb7249294ff8ac247d4 Mon Sep 17 00:00:00 2001 From: Rob Smart Date: Wed, 9 Sep 2009 19:42:53 +0100 Subject: The stubs for an authorization service, at the moment the service will always grant access to an avatar entering the region if requested. --- OpenSim/Region/Framework/Scenes/Scene.cs | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5e27eff..1346844 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -134,6 +134,7 @@ namespace OpenSim.Region.Framework.Scenes public IXfer XferManager; protected IAssetService m_AssetService = null; + protected IAuthorizationService m_AuthorizationService = null; public IAssetService AssetService { @@ -152,6 +153,25 @@ namespace OpenSim.Region.Framework.Scenes return m_AssetService; } } + + public IAuthorizationService AuthorizationService + { + get + { + if (m_AuthorizationService == null) + { + m_AuthorizationService = RequestModuleInterface(); + + if (m_AuthorizationService == null) + { + // don't throw an exception if no authorization service is set for the time being + m_log.InfoFormat("[SCENE]: No Authorization service is configured"); + } + } + + return m_AuthorizationService; + } + } protected IInventoryService m_InventoryService = null; @@ -3230,7 +3250,18 @@ namespace OpenSim.Region.Framework.Scenes if (!m_strictAccessControl) return true; if (Permissions.IsGod(agent.AgentID)) return true; - + + UserProfileData userProfile = CommsManager.UserService.GetUserProfile(agent.AgentID); + + if(AuthorizationService!=null) + { + if(!AuthorizationService.isAuthorizedForRegion(userProfile,RegionInfo)) + { + 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); + return false; + } + } if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) { -- cgit v1.1