diff options
author | Diva Canto | 2009-09-10 19:56:08 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-10 19:56:08 -0700 |
commit | ce332f235ccc5168cfc44834e16318497c67cdd7 (patch) | |
tree | 27e0f79a50060c981dffd4dbffe5938d70cad2a3 /OpenSim/Services | |
parent | added AuthorizationRequest and AuthorizationResponse objects for passing Auth... (diff) | |
download | opensim-SC-ce332f235ccc5168cfc44834e16318497c67cdd7.zip opensim-SC-ce332f235ccc5168cfc44834e16318497c67cdd7.tar.gz opensim-SC-ce332f235ccc5168cfc44834e16318497c67cdd7.tar.bz2 opensim-SC-ce332f235ccc5168cfc44834e16318497c67cdd7.tar.xz |
Changed the interface of IAuthorizationService to get less data.
Diffstat (limited to 'OpenSim/Services')
3 files changed, 9 insertions, 11 deletions
diff --git a/OpenSim/Services/AuthorizationService/AuthorizationService.cs b/OpenSim/Services/AuthorizationService/AuthorizationService.cs index e779325..c795ba0 100644 --- a/OpenSim/Services/AuthorizationService/AuthorizationService.cs +++ b/OpenSim/Services/AuthorizationService/AuthorizationService.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Services.AuthorizationService | |||
48 | m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled"); | 48 | m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled"); |
49 | } | 49 | } |
50 | 50 | ||
51 | public bool isAuthorizedForRegion(UserProfileData user, RegionInfo region) | 51 | public bool IsAuthorizedForRegion(string userID, string regionID) |
52 | { | 52 | { |
53 | return true; | 53 | return true; |
54 | } | 54 | } |
diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs index d65afc6..d50a6ed 100644 --- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs | |||
@@ -88,14 +88,14 @@ namespace OpenSim.Services.Connectors | |||
88 | m_ResponseOnFailure = responseOnFailure; | 88 | m_ResponseOnFailure = responseOnFailure; |
89 | } | 89 | } |
90 | 90 | ||
91 | public bool isAuthorizedForRegion(UserProfileData user, RegionInfo region) | 91 | public bool IsAuthorizedForRegion(string userID, string regionID) |
92 | { | 92 | { |
93 | // do a remote call to the authorization server specified in the AuthorizationServerURI | 93 | // do a remote call to the authorization server specified in the AuthorizationServerURI |
94 | m_log.InfoFormat("[AUTHORIZATION CONNECTOR]: isAuthorizedForRegion checking {0} {1} at remote server {2}",user.FirstName,user.SurName, m_ServerURI); | 94 | m_log.InfoFormat("[AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} at remote server {1}", userID, m_ServerURI); |
95 | 95 | ||
96 | string uri = m_ServerURI; | 96 | string uri = m_ServerURI; |
97 | 97 | ||
98 | AuthorizationRequest req = new AuthorizationRequest(user.ID.ToString(),user.FirstName,user.SurName,user.Email,region.RegionName,region.RegionID.ToString()); | 98 | AuthorizationRequest req = new AuthorizationRequest(userID, regionID); |
99 | 99 | ||
100 | AuthorizationResponse response; | 100 | AuthorizationResponse response; |
101 | try | 101 | try |
@@ -104,16 +104,14 @@ namespace OpenSim.Services.Connectors | |||
104 | } | 104 | } |
105 | catch (Exception e) | 105 | catch (Exception e) |
106 | { | 106 | { |
107 | m_log.WarnFormat("[AUTHORIZATION CONNECTOR]: Unable to send authorize {0} {1} for region {2} error thrown during comms with remote server. Reason: {3}", user.FirstName,user.SurName,region.RegionName, e.Message); | 107 | 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); |
108 | m_log.WarnFormat("Inner Exception is {0}",e.InnerException); | 108 | m_log.WarnFormat("Inner Exception is {0}",e.InnerException); |
109 | return m_ResponseOnFailure; | 109 | return m_ResponseOnFailure; |
110 | } | 110 | } |
111 | 111 | ||
112 | m_log.DebugFormat("[AUTHORIZATION CONNECTOR] response from remote service was {0}",response.Message); | 112 | m_log.DebugFormat("[AUTHORIZATION CONNECTOR] response from remote service was {0}", response.Message); |
113 | if(response.IsAuthorized) | 113 | |
114 | return true; | 114 | return response.IsAuthorized; |
115 | else | ||
116 | return false; | ||
117 | } | 115 | } |
118 | 116 | ||
119 | } | 117 | } |
diff --git a/OpenSim/Services/Interfaces/IAuthorizationService.cs b/OpenSim/Services/Interfaces/IAuthorizationService.cs index e8b7298..6acd1f6 100644 --- a/OpenSim/Services/Interfaces/IAuthorizationService.cs +++ b/OpenSim/Services/Interfaces/IAuthorizationService.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Services.Interfaces | |||
40 | // This method returns a simple true false indicating | 40 | // This method returns a simple true false indicating |
41 | // whether or not a user has access to the region | 41 | // whether or not a user has access to the region |
42 | // | 42 | // |
43 | bool isAuthorizedForRegion(UserProfileData user, RegionInfo region); | 43 | bool IsAuthorizedForRegion(string userID, string regionID); |
44 | 44 | ||
45 | } | 45 | } |
46 | } | 46 | } |