diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
3 files changed, 26 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs index 4470799..93dff1f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs | |||
@@ -89,35 +89,43 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
89 | public bool IsAuthorizedForRegion( | 89 | public bool IsAuthorizedForRegion( |
90 | string user, string firstName, string lastName, string regionID, out string message) | 90 | string user, string firstName, string lastName, string regionID, out string message) |
91 | { | 91 | { |
92 | message = "authorized"; | ||
93 | |||
94 | // This should not happen | 92 | // This should not happen |
95 | if (m_Scene.RegionInfo.RegionID.ToString() != regionID) | 93 | if (m_Scene.RegionInfo.RegionID.ToString() != regionID) |
96 | { | 94 | { |
97 | m_log.WarnFormat("[AuthorizationService]: Service for region {0} received request to authorize for region {1}", | 95 | m_log.WarnFormat("[AuthorizationService]: Service for region {0} received request to authorize for region {1}", |
98 | m_Scene.RegionInfo.RegionID, regionID); | 96 | m_Scene.RegionInfo.RegionID, regionID); |
99 | return true; | 97 | message = string.Format("Region {0} received request to authorize for region {1}", m_Scene.RegionInfo.RegionID, regionID); |
98 | return false; | ||
100 | } | 99 | } |
101 | 100 | ||
102 | if (m_accessValue == AccessFlags.None) | 101 | if (m_accessValue == AccessFlags.None) |
102 | { | ||
103 | message = "Authorized"; | ||
103 | return true; | 104 | return true; |
105 | } | ||
104 | 106 | ||
105 | UUID userID = new UUID(user); | 107 | UUID userID = new UUID(user); |
106 | bool authorized = true; | 108 | |
107 | if ((m_accessValue & AccessFlags.DisallowForeigners) == AccessFlags.DisallowForeigners) | 109 | if ((m_accessValue & AccessFlags.DisallowForeigners) != 0) |
108 | { | 110 | { |
109 | authorized = m_UserManagement.IsLocalGridUser(userID); | 111 | if (!m_UserManagement.IsLocalGridUser(userID)) |
110 | if (!authorized) | 112 | { |
111 | message = "no foreigner users allowed in this region"; | 113 | message = "No foreign users allowed in this region"; |
114 | return false; | ||
115 | } | ||
112 | } | 116 | } |
113 | if (authorized && (m_accessValue & AccessFlags.DisallowResidents) == AccessFlags.DisallowResidents) | 117 | |
118 | if ((m_accessValue & AccessFlags.DisallowResidents) != 0) | ||
114 | { | 119 | { |
115 | authorized = m_Scene.Permissions.IsGod(userID) | m_Scene.Permissions.IsAdministrator(userID); | 120 | if (!(m_Scene.Permissions.IsGod(userID) || m_Scene.Permissions.IsAdministrator(userID))) |
116 | if (!authorized) | 121 | { |
117 | message = "only Admins and Managers allowed in this region"; | 122 | message = "Only Admins and Managers allowed in this region"; |
123 | return false; | ||
124 | } | ||
118 | } | 125 | } |
119 | 126 | ||
120 | return authorized; | 127 | message = "Authorized"; |
128 | return true; | ||
121 | } | 129 | } |
122 | 130 | ||
123 | } | 131 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 3348b42..926ef05 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
264 | return true; | 264 | return true; |
265 | } | 265 | } |
266 | 266 | ||
267 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) | 267 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason) |
268 | { | 268 | { |
269 | reason = "Communications failure"; | 269 | reason = "Communications failure"; |
270 | version = ServiceVersion; | 270 | version = ServiceVersion; |
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
277 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | 277 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", |
278 | // s.RegionInfo.RegionName, destination.RegionHandle); | 278 | // s.RegionInfo.RegionName, destination.RegionHandle); |
279 | 279 | ||
280 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, position, out reason); | 280 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason); |
281 | } | 281 | } |
282 | 282 | ||
283 | //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); | 283 | //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 8436488..0444e49 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
208 | } | 208 | } |
209 | 209 | ||
210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) | 210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason) |
211 | { | 211 | { |
212 | reason = "Communications failure"; | 212 | reason = "Communications failure"; |
213 | version = "Unknown"; | 213 | version = "Unknown"; |
@@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
216 | return false; | 216 | return false; |
217 | 217 | ||
218 | // Try local first | 218 | // Try local first |
219 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason)) | 219 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason)) |
220 | return true; | 220 | return true; |
221 | 221 | ||
222 | // else do the remote thing | 222 | // else do the remote thing |
223 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) | 223 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
224 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason); | 224 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason); |
225 | 225 | ||
226 | return false; | 226 | return false; |
227 | } | 227 | } |