public List <string> GetAssignedRoles(RmPerson person) { List <string> retVal = new List <string>(); foreach (RmUserAssignment assignment in Base_GetResourceByAttribute(RmUserAssignment.StaticResourceType(), RmUserAssignment.AttributeNames.AssignedUser.Name, person.ObjectID.Value, OperationType.Opration_Is, new string[] { RmUserAssignment.AttributeNames.AssignedRole.Name })) { if (assignment != null) { if (!retVal.Contains(assignment.AssignedRole.Value)) { retVal.Add(assignment.AssignedRole.Value); } } } return(retVal); }
public List <RmRole> GetAssignedRoles(RmGroup group, string[] attributes) { List <RmRole> retVal = new List <RmRole>(); foreach (RmUserAssignment assignment in Base_GetResourceByAttribute( RmUserAssignment.StaticResourceType(), RmUserAssignment.AttributeNames.AssignedUser.Name, group.ObjectID.Value, OperationType.Opration_Is, new string[] { RmUserAssignment.AttributeNames.AssignedRole.Name })) { RmRole role = Base_GetResourceById(RmRole.StaticResourceType(), assignment.AssignedRole.Value, attributes) as RmRole; if (role != null) { if (!retVal.Any(r => r.ObjectID.Value == role.ObjectID.Value)) { retVal.Add(role); } } } return(retVal); }