From e103e34f1d17d218c55ebb1ff19450c018cf73b2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 24 Jul 2013 11:23:19 -0700 Subject: [PATCH] Added config var that we all thought was already there: see_into_region. (Note: different from the defunct see_into_neighboring_sim, which used to control the process from the other end). This enables child agents in neighbors for which the root agent doesn't have permission to be in. --- OpenSim/Region/Framework/Scenes/Scene.cs | 81 ++++++++++++++---------- bin/OpenSimDefaults.ini | 3 + 2 files changed, 49 insertions(+), 35 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9cfe869098..e443c1d75d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -230,6 +230,8 @@ namespace OpenSim.Region.Framework.Scenes public int MaxUndoCount { get; set; } + public bool SeeIntoRegion { get; set; } + // Using this for RegionReady module to prevent LoginsDisabled from changing under our feet; public bool LoginLock = false; @@ -839,6 +841,8 @@ namespace OpenSim.Region.Framework.Scenes //Animation states m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); + SeeIntoRegion = startupConfig.GetBoolean("see_into_region", true); + MaxUndoCount = startupConfig.GetInt("MaxPrimUndos", 20); PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims); @@ -4010,52 +4014,59 @@ namespace OpenSim.Region.Framework.Scenes m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); } - List agentGroups = new List(); - - if (m_groupsModule != null) + // We only test the things below when we want to cut off + // child agents from being present in the scene for which their root + // agent isn't allowed. Otherwise, we allow child agents. The test for + // the root is done elsewhere (QueryAccess) + if (!SeeIntoRegion) { - GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); + List agentGroups = new List(); - if (GroupMembership != null) + if (m_groupsModule != null) { - for (int i = 0; i < GroupMembership.Length; i++) - agentGroups.Add(GroupMembership[i].GroupID); + GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); + + if (GroupMembership != null) + { + for (int i = 0; i < GroupMembership.Length; i++) + agentGroups.Add(GroupMembership[i].GroupID); + } + else + { + m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); + } + } + + bool groupAccess = false; + UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups; + + if (estateGroups != null) + { + foreach (UUID group in estateGroups) + { + if (agentGroups.Contains(group)) + { + groupAccess = true; + break; + } + } } else { - m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); + m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); } - } - bool groupAccess = false; - UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups; - - if (estateGroups != null) - { - foreach (UUID group in estateGroups) + if (!RegionInfo.EstateSettings.PublicAccess && + !RegionInfo.EstateSettings.HasAccess(agent.AgentID) && + !groupAccess) { - if (agentGroups.Contains(group)) - { - groupAccess = true; - break; - } + m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", + agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); + reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", + RegionInfo.RegionName); + return false; } } - else - { - m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); - } - - if (!RegionInfo.EstateSettings.PublicAccess && - !RegionInfo.EstateSettings.HasAccess(agent.AgentID) && - !groupAccess) - { - m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", - agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); - reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", - RegionInfo.RegionName); - return false; - } // TODO: estate/region settings are not properly hooked up // to ILandObject.isRestrictedFromLand() diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 8079632368..6aa534a77e 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -86,6 +86,9 @@ ;; from the selected region_info_source. allow_regionless = false + ;; Allow child agents to see into the region even if their root counterpart isn't allowed in here + see_into_region = true + ; Maximum number of position, rotation and scale changes for each prim that the simulator will store for later undos ; Increasing this number will increase memory usage. MaxPrimUndos = 20