From 673a52fa7a0cef508396cfc2185825e72cf96507 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 9 Jan 2010 15:58:18 +0000 Subject: Implement the groups module query to make the estate allowed groups work --- OpenSim/Region/Framework/Scenes/Scene.cs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 764ac60..183d811 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3525,8 +3525,35 @@ namespace OpenSim.Region.Framework.Scenes return false; } + IGroupsModule groupsModule = + RequestModuleInterface(); + + List agentGroups = new List(); + + if (groupsModule != null) + { + GroupMembershipData[] GroupMembership = + groupsModule.GetMembershipData(agent.AgentID); + + for (int i = 0; i < GroupMembership.Length; i++) + agentGroups.Add(GroupMembership[i].GroupID); + } + + bool groupAccess = false; + UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; + + foreach (UUID group in estateGroups) + { + if (agentGroups.Contains(group)) + { + groupAccess = true; + break; + } + } + if (!m_regInfo.EstateSettings.PublicAccess && - !m_regInfo.EstateSettings.HasAccess(agent.AgentID)) + !m_regInfo.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); -- cgit v1.1