예제 #1
0
        public List <GroupRoleMembersData> GetGroupRoleMembers(string RequestingAgentID, UUID groupID)
        {
            string url = string.Empty, gname = string.Empty;

            if (IsLocal(groupID, out url, out gname))
            {
                return(m_LocalGroupsConnector.GetGroupRoleMembers(AgentUUI(RequestingAgentID), groupID));
            }
            else if (!string.IsNullOrEmpty(url))
            {
                ExtendedGroupMembershipData membership = m_LocalGroupsConnector.GetAgentGroupMembership(RequestingAgentID, RequestingAgentID, groupID);
                string accessToken = string.Empty;
                if (membership != null)
                {
                    accessToken = membership.AccessToken;
                }
                else
                {
                    return(null);
                }

                GroupsServiceHGConnector c = GetConnector(url);
                if (c != null)
                {
                    return(m_CacheWrapper.GetGroupRoleMembers(RequestingAgentID, groupID, delegate
                    {
                        return c.GetGroupRoleMembers(AgentUUIForOutside(RequestingAgentID), groupID, accessToken);
                    }));
                }
            }

            return(new List <GroupRoleMembersData>());
        }
        public List <GroupRoleMembersData> GetGroupRoleMembers(string RequestingAgentID, UUID groupID)
        {
            if (m_log.IsDebugEnabled)
            {
                m_log.DebugFormat("{0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
            }


            string url = string.Empty, gname = string.Empty;

            if (IsLocal(groupID, out url, out gname))
            {
                return(m_LocalGroupsConnector.GetGroupRoleMembers(AgentUUI(RequestingAgentID), groupID));
            }
            else if (!string.IsNullOrEmpty(url))
            {
                ExtendedGroupMembershipData membership = m_LocalGroupsConnector.GetAgentGroupMembership(RequestingAgentID, RequestingAgentID, groupID);
                string accessToken = string.Empty;
                if (membership != null)
                {
                    accessToken = membership.AccessToken;
                }
                else
                {
                    return(null);
                }

                GroupsServiceHGConnector c = GetConnector(url);
                if (c != null)
                {
                    return(m_CacheWrapper.GetGroupRoleMembers(RequestingAgentID, groupID, delegate
                    {
                        return c.GetGroupRoleMembers(AgentUUIForOutside(RequestingAgentID), groupID, accessToken);
                    }));
                }
            }

            return(new List <GroupRoleMembersData>());
        }