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); }
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); }
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); }
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; })); }
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; })); }
public RmOrgUnit GetOrgUnitById(string objectId, string[] attributes) { return(Base_GetResourceById(RmOrgUnit.StaticResourceType(), objectId, attributes) as RmOrgUnit); }
public RmOrgUnit GetOrgUnitByDisplayName(string displayName, string[] attributes) { return(Base_GetResourceByDisplayName(RmOrgUnit.StaticResourceType(), displayName, attributes) as RmOrgUnit); }
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; })); }