byte[] HandleAddAgentToGroup(Dictionary <string, object> request) { Dictionary <string, object> result = new Dictionary <string, object>(); if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("AgentID") || !request.ContainsKey("GroupID") || !request.ContainsKey("RoleID")) { NullResult(result, "Bad network data"); } else { UUID groupID = new UUID(request["GroupID"].ToString()); UUID roleID = new UUID(request["RoleID"].ToString()); string agentID = request["AgentID"].ToString(); string requestingAgentID = request["RequestingAgentID"].ToString(); string token = string.Empty; string reason = string.Empty; if (request.ContainsKey("AccessToken")) { token = request["AccessToken"].ToString(); } if (!m_GroupsService.AddAgentToGroup(requestingAgentID, agentID, groupID, roleID, token, out reason)) { NullResult(result, reason); } else { GroupMembershipData membership = m_GroupsService.GetAgentGroupMembership(requestingAgentID, agentID, groupID); if (membership == null) { NullResult(result, "Internal error"); } else { result["RESULT"] = GroupsDataUtils.GroupMembershipData((ExtendedGroupMembershipData)membership); } } } string xmlString = ServerUtils.BuildXmlResponse(result); //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); return(Util.UTF8NoBomEncoding.GetBytes(xmlString)); }
public ExtendedGroupMembershipData GetAgentGroupMembership(string RequestingAgentID, string AgentID, UUID GroupID) { return(m_GroupsService.GetAgentGroupMembership(RequestingAgentID, AgentID, GroupID));; }