예제 #1
0
        public void RecursiveDeleteOU(RmReference topOUID)
        {
            foreach (RmOrgUnit orgUnit in Base_GetResourceByAttribute(RmOrgUnit.StaticResourceType(), RmOrgUnit.AttributeNames.ParentRef.Name, topOUID.Value,
                                                                      OperationType.Opration_Is, new string[] { RmResource.AttributeNames.ObjectID.Name }))
            {
                RecursiveDeleteOU(orgUnit.ObjectID);
            }

            DeleteResource(topOUID);
        }
예제 #2
0
        public bool ContainsDisplayName(string parentOUID, string displayName)
        {
            foreach (RmOrgUnit orgUnit in Base_GetResourceByAttribute(RmOrgUnit.StaticResourceType(), RmOrgUnit.AttributeNames.ParentRef.Name, parentOUID,
                                                                      OperationType.Opration_Is, new string[] { RmResource.AttributeNames.DisplayName.Name }))
            {
                if (orgUnit.DisplayName.Equals(displayName, StringComparison.OrdinalIgnoreCase))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #3
0
        public List <RmRole> GetAllAvailableRoles(string personID, string[] attributes)
        {
            List <RmRole> retVal     = new List <RmRole>();
            List <string> roleIDList = new List <string>();

            foreach (RmOrgAssignment ouAssignment in Base_GetResourceByAttribute(
                         RmOrgAssignment.StaticResourceType(),
                         RmOrgAssignment.AttributeNames.AssignedUser.Name,
                         personID,
                         OperationType.Opration_Is,
                         new string[] { RmOrgAssignment.AttributeNames.AssignedOrgUnit.Name }))
            {
                if (ouAssignment != null)
                {
                    RmOrgUnit ou = Base_GetResourceById(RmOrgUnit.StaticResourceType(), ouAssignment.AssignedOrgUnit.Value,
                                                        new string[] { RmOrgUnit.AttributeNames.RoleRefList.Name }) as RmOrgUnit;
                    if (ou != null && ou.RoleRefList != null)
                    {
                        foreach (RmReference roleRef in ou.RoleRefList)
                        {
                            if (roleRef != null)
                            {
                                if (!roleIDList.Contains(roleRef.Value))
                                {
                                    RmRole role = Base_GetResourceById(RmRole.StaticResourceType(), roleRef.Value, attributes) as RmRole;
                                    if (role != null)
                                    {
                                        retVal.Add(role);
                                        roleIDList.Add(role.ObjectID.Value);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return(retVal);
        }
예제 #4
0
        public List <RmOrgUnit> GetOrgUnitByQuery(string query, string[] attributes)
        {
            List <RmResource> resourceList = Base_GetResourceByQuery(RmOrgUnit.StaticResourceType(), query, attributes);

            return(resourceList.ConvertAll <RmOrgUnit>(delegate(RmResource r) { return r as RmOrgUnit; }));
        }
예제 #5
0
        public List <RmOrgUnit> GetOrgUnitByAttribute(string attributeName, string value, OperationType operation, string[] attributes)
        {
            List <RmResource> resourceList = Base_GetResourceByAttribute(RmOrgUnit.StaticResourceType(), attributeName, value, operation, attributes);

            return(resourceList.ConvertAll <RmOrgUnit>(delegate(RmResource r) { return r as RmOrgUnit; }));
        }
예제 #6
0
 public RmOrgUnit GetOrgUnitById(string objectId, string[] attributes)
 {
     return(Base_GetResourceById(RmOrgUnit.StaticResourceType(), objectId, attributes) as RmOrgUnit);
 }
예제 #7
0
 public RmOrgUnit GetOrgUnitByDisplayName(string displayName, string[] attributes)
 {
     return(Base_GetResourceByDisplayName(RmOrgUnit.StaticResourceType(), displayName, attributes) as RmOrgUnit);
 }
예제 #8
0
        public List <RmOrgUnit> GetAllOrgUnit(string[] attributes)
        {
            List <RmResource> resourceList = Base_GetAllResource(RmOrgUnit.StaticResourceType(), attributes);

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