diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 31 |
1 files changed, 22 insertions, 9 deletions
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 | |||
1223 | 1223 | ||
1224 | /// <summary> | 1224 | /// <summary> |
1225 | /// Get a list of groups memberships for the agent that are marked "ListInProfile" | 1225 | /// Get a list of groups memberships for the agent that are marked "ListInProfile" |
1226 | /// (unless that agent has a godLike aspect, in which case get all groups) | ||
1226 | /// </summary> | 1227 | /// </summary> |
1227 | /// <param name="dataForAgentID"></param> | 1228 | /// <param name="dataForAgentID"></param> |
1228 | /// <returns></returns> | 1229 | /// <returns></returns> |
@@ -1231,20 +1232,31 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1231 | List<GroupMembershipData> membershipData = m_groupData.GetAgentGroupMemberships(requestingClient.AgentId, dataForAgentID); | 1232 | List<GroupMembershipData> membershipData = m_groupData.GetAgentGroupMemberships(requestingClient.AgentId, dataForAgentID); |
1232 | GroupMembershipData[] membershipArray; | 1233 | GroupMembershipData[] membershipArray; |
1233 | 1234 | ||
1234 | if (requestingClient.AgentId != dataForAgentID) | 1235 | // cScene and property accessor 'isGod' are in support of the opertions to bypass 'hidden' group attributes for |
1235 | { | 1236 | // those with a GodLike aspect. |
1236 | Predicate<GroupMembershipData> showInProfile = delegate(GroupMembershipData membership) | 1237 | Scene cScene = (Scene) requestingClient.Scene; |
1237 | { | 1238 | bool isGod = cScene.Permissions.IsGod(requestingClient.AgentId); |
1238 | return membership.ListInProfile; | ||
1239 | }; | ||
1240 | 1239 | ||
1241 | membershipArray = membershipData.FindAll(showInProfile).ToArray(); | 1240 | if (isGod) { |
1241 | membershipArray = membershipData.ToArray(); | ||
1242 | } | 1242 | } |
1243 | else | 1243 | else |
1244 | { | 1244 | { |
1245 | membershipArray = membershipData.ToArray(); | ||
1246 | } | ||
1247 | 1245 | ||
1246 | if (requestingClient.AgentId != dataForAgentID) | ||
1247 | { | ||
1248 | Predicate<GroupMembershipData> showInProfile = delegate(GroupMembershipData membership) | ||
1249 | { | ||
1250 | return membership.ListInProfile; | ||
1251 | }; | ||
1252 | |||
1253 | membershipArray = membershipData.FindAll(showInProfile).ToArray(); | ||
1254 | } | ||
1255 | else | ||
1256 | { | ||
1257 | membershipArray = membershipData.ToArray(); | ||
1258 | } | ||
1259 | } | ||
1248 | if (m_debugEnabled) | 1260 | if (m_debugEnabled) |
1249 | { | 1261 | { |
1250 | m_log.InfoFormat("[GROUPS]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId); | 1262 | 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 | |||
1257 | return membershipArray; | 1269 | return membershipArray; |
1258 | } | 1270 | } |
1259 | 1271 | ||
1272 | |||
1260 | private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle) | 1273 | private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle) |
1261 | { | 1274 | { |
1262 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 1275 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |