The stubs for an authorization service, at the moment the service will always grant access to an avatar entering the region if requested.

This commit is contained in:
Rob Smart
2009-09-09 19:42:53 +01:00
committed by Diva Canto
parent 552ba5334f
commit 16940097be
14 changed files with 732 additions and 1 deletions

View File

@@ -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<IAuthorizationService>();
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))
{