mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user