From ea5bab51071c613b5412978b56c058aeef40bcb2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 26 Aug 2013 20:04:07 +0100 Subject: [PATCH] For a Hypergrid user, delay estate access checks until NewUserConnection() so that they work. This is necessary because the hypergrid groups checks (as referenced by estates) require an agent circuit to be present to construct the hypergrid ID. However, this is not around until Scene.NewUserConnection(), as called by CreateAgent() in EntityTransferModule. Therefore, if we're dealing with a hypergrid user, delay the check until NewUserConnection()/CreateAgent() The entity transfer impact should be minimal since CreateAgent() is the next significant call after NewUserConnection() However, to preserve the accuracy of query access we will only relax the check for HG users. --- OpenSim/Region/Framework/Scenes/Scene.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index cb12d65c0a..054e17bae1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5739,9 +5739,13 @@ namespace OpenSim.Region.Framework.Scenes try { - if (!AuthorizeUser(aCircuit, false, out reason)) + // If this is a hypergrid user, then we can't perform a successful groups access check here since this + // currently relies on a circuit being present in the AuthenticateHandler to construct a Hypergrid ID. + // This is only present in NewUserConnection() which entity transfer calls very soon after QueryAccess(). + // Therefore, we'll defer to the check in NewUserConnection() instead. + if (!AuthorizeUser(aCircuit, !UserManagementModule.IsLocalGridUser(agentID), out reason)) { - // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); + //m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); return false; } }