From c43ad8a0e7728c41ed2a4aed6a8b76678aaa7071 Mon Sep 17 00:00:00 2001
From: James Stallings aka Hiro Protagonist
Date: Tue, 31 May 2011 19:33:40 -0500
Subject: A final couple of tweaks to GroupsModule.cs. Remove unneeded
delegate, and prettify codeing style/formatting
---
.../Avatar/XmlRpcGroups/GroupsModule.cs | 31 +++++++++++++++-------
1 file changed, 22 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index 1c791b9..61c5503 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -1223,6 +1223,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
///
/// Get a list of groups memberships for the agent that are marked "ListInProfile"
+ /// (unless that agent has a godLike aspect, in which case get all groups)
///
///
///
@@ -1231,20 +1232,31 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
List membershipData = m_groupData.GetAgentGroupMemberships(requestingClient.AgentId, dataForAgentID);
GroupMembershipData[] membershipArray;
- if (requestingClient.AgentId != dataForAgentID)
- {
- Predicate showInProfile = delegate(GroupMembershipData membership)
- {
- return membership.ListInProfile;
- };
+ // cScene and property accessor 'isGod' are in support of the opertions to bypass 'hidden' group attributes for
+ // those with a GodLike aspect.
+ Scene cScene = (Scene) requestingClient.Scene;
+ bool isGod = cScene.Permissions.IsGod(requestingClient.AgentId);
- membershipArray = membershipData.FindAll(showInProfile).ToArray();
+ if (isGod) {
+ membershipArray = membershipData.ToArray();
}
else
{
- membershipArray = membershipData.ToArray();
- }
+ if (requestingClient.AgentId != dataForAgentID)
+ {
+ Predicate showInProfile = delegate(GroupMembershipData membership)
+ {
+ return membership.ListInProfile;
+ };
+
+ membershipArray = membershipData.FindAll(showInProfile).ToArray();
+ }
+ else
+ {
+ membershipArray = membershipData.ToArray();
+ }
+ }
if (m_debugEnabled)
{
m_log.InfoFormat("[GROUPS]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId);
@@ -1257,6 +1269,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return membershipArray;
}
+
private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
--
cgit v1.1