public List<GroupTitlesData> GetGroupTitles(UUID requestingAgentID, UUID GroupID) { List<GroupRolesData> agentRoles = GetAgentGroupRoles(requestingAgentID, requestingAgentID, GroupID); GroupMembershipData agentMembership = GetAgentGroupMembership( requestingAgentID, requestingAgentID, GroupID); List<GroupTitlesData> titles = new List<GroupTitlesData>(); foreach (GroupRolesData role in agentRoles) { GroupTitlesData title = new GroupTitlesData { Name = role.Title, UUID = role.RoleID }; if (agentMembership != null) title.Selected = agentMembership.ActiveRole == role.RoleID; titles.Add(title); } return titles; }
/// <summary> /// Get the Role Titles for an Agent, for a specific group /// </summary> public List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID) { if (m_debugEnabled) MainConsole.Instance.DebugFormat("[GROUPS]: {0} called", MethodBase.GetCurrentMethod().Name); List<GroupRolesData> agentRoles = m_groupData.GetAgentGroupRoles(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID); GroupMembershipData agentMembership = m_groupData.GetAgentGroupMembership( GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID); List<GroupTitlesData> titles = new List<GroupTitlesData>(); foreach (GroupRolesData role in agentRoles) { GroupTitlesData title = new GroupTitlesData {Name = role.Name}; if (agentMembership != null) { title.Selected = agentMembership.ActiveRole == role.RoleID; } title.UUID = role.RoleID; titles.Add(title); } return titles; }