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

This commit is contained in:
Rob Smart
2009-09-16 13:34:14 +01:00
committed by Diva Canto
parent 8622f205d7
commit 281ad1251c
7 changed files with 15 additions and 9 deletions

View File

@@ -48,8 +48,9 @@ namespace OpenSim.Services.AuthorizationService
m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled");
}
public bool IsAuthorizedForRegion(string userID, string regionID)
public bool IsAuthorizedForRegion(string userID, string regionID, out string message)
{
message = "Authorized";
return true;
}
}

View File

@@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors
m_ResponseOnFailure = responseOnFailure;
}
public bool IsAuthorizedForRegion(string userID, string firstname, string surname, string email, string regionName, string regionID)
public bool IsAuthorizedForRegion(string userID, string firstname, string surname, string email, string regionName, string regionID, out string message)
{
// do a remote call to the authorization server specified in the AuthorizationServerURI
m_log.InfoFormat("[AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} at remote server {1}", userID, m_ServerURI);
@@ -105,10 +105,12 @@ namespace OpenSim.Services.Connectors
catch (Exception e)
{
m_log.WarnFormat("[AUTHORIZATION CONNECTOR]: Unable to send authorize {0} for region {1} error thrown during comms with remote server. Reason: {2}", userID, regionID, e.Message);
message="";
return m_ResponseOnFailure;
}
m_log.DebugFormat("[AUTHORIZATION CONNECTOR] response from remote service was {0}", response.Message);
message = response.Message;
return response.IsAuthorized;
}

View File

@@ -40,7 +40,7 @@ namespace OpenSim.Services.Interfaces
// This method returns a simple true false indicating
// whether or not a user has access to the region
//
bool IsAuthorizedForRegion(string userID, string regionID);
bool IsAuthorizedForRegion(string userID, string regionID, out string message);
}