コード例 #1
0
        public List <string> GetPermissionGroupBackLink(RmGroup group)
        {
            List <string> retVal = new List <string>();

            foreach (RmRole role in Base_GetResourceByAttribute(RmRole.StaticResourceType(), RmRole.AttributeNames.PremissionRefs.Name, group.ObjectID.Value,
                                                                OperationType.Opration_Is, new string[] { RmResource.AttributeNames.ObjectID.Name }))
            {
                if (role != null)
                {
                    foreach (RmPerson person in Base_GetResourceByAttribute(RmPerson.StaticResourceType(), RmPerson.AttributeNames.RoleRefList.Name,
                                                                            role.ObjectID.Value, OperationType.Opration_Is, new string[] { RmResource.AttributeNames.ObjectID.Name }))
                    {
                        if (person != null)
                        {
                            if (!retVal.Contains(person.ObjectID.Value))
                            {
                                retVal.Add(person.ObjectID.Value);
                            }
                        }
                    }
                }
            }

            return(retVal);
        }
コード例 #2
0
ファイル: GroupControl.cs プロジェクト: sagius-li/Lydia
        public RmResource GetGroupDisplayedOwner(RmGroup group, string[] attributes)
        {
            RmPerson person = Base_GetResourceById(RmPerson.StaticResourceType(), group.DisplayedOwner.Value, attributes) as RmPerson;

            if (person != null)
            {
                return(person);
            }

            return(Base_GetResourceById(RmGroup.StaticResourceType(), group.DisplayedOwner.Value, attributes));
        }
コード例 #3
0
        public RmPerson GetPersonByDomainAccount(string domainAccount, string[] attributes)
        {
            string[] da = domainAccount.Split(@"\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            if (da.Length != 2)
            {
                return(null);
            }

            string filter = string.Format("[{0}='{1}' and {2}='{3}']", RmPerson.AttributeNames.Domain.Name, da[0], RmPerson.AttributeNames.AccountName.Name, da[1]);

            foreach (RmPerson person in Base_GetResourceByQuery(RmPerson.StaticResourceType(), filter, attributes))
            {
                return(person);
            }

            return(null);
        }
コード例 #4
0
ファイル: GroupControl.cs プロジェクト: sagius-li/Lydia
        public List <RmResource> GetGroupExplicitMembers(RmGroup group, string[] attributes)
        {
            List <RmResource> retVal = new List <RmResource>();

            foreach (RmReference memberRef in group.ExplicitMember)
            {
                RmPerson person = Base_GetResourceById(RmPerson.StaticResourceType(), memberRef.Value, attributes) as RmPerson;
                if (person != null)
                {
                    retVal.Add(person);
                    continue;
                }

                RmGroup gp = Base_GetResourceById(RmGroup.StaticResourceType(), memberRef.Value, attributes) as RmGroup;
                if (gp != null)
                {
                    retVal.Add(gp);
                }
            }

            return(retVal);
        }
コード例 #5
0
        public List <RmPerson> GetPersonByQuery(string query, string[] attributes)
        {
            List <RmResource> resourceList = Base_GetResourceByQuery(RmPerson.StaticResourceType(), query, attributes);

            return(resourceList.ConvertAll <RmPerson>(delegate(RmResource r) { return r as RmPerson; }));
        }
コード例 #6
0
        public List <RmPerson> GetPersonByAttribute(string attributeName, string value, OperationType operation, string[] attributes)
        {
            List <RmResource> resourceList = Base_GetResourceByAttribute(RmPerson.StaticResourceType(), attributeName, value, operation, attributes);

            return(resourceList.ConvertAll <RmPerson>(delegate(RmResource r) { return r as RmPerson; }));
        }
コード例 #7
0
 public RmPerson GetPersonById(string objectId, string[] attributes)
 {
     return(Base_GetResourceById(RmPerson.StaticResourceType(), objectId, attributes) as RmPerson);
 }
コード例 #8
0
 public RmPerson GetPersonByDisplayName(string displayName, string[] attributes)
 {
     return(Base_GetResourceByDisplayName(RmPerson.StaticResourceType(), displayName, attributes) as RmPerson);
 }
コード例 #9
0
        public List <RmPerson> GetAllPerson(string[] attributes)
        {
            List <RmResource> resourceList = Base_GetAllResource(RmPerson.StaticResourceType(), attributes);

            return(resourceList.ConvertAll <RmPerson>(delegate(RmResource r) { return r as RmPerson; }));
        }