private IList <Sys_Role> GetRoleList(string userName) { IList <Sys_Role> result = new List <Sys_Role>(); IList <Sys_UserInRole> list1 = _uirRepository.GetRolesForUser(_applicationName, userName); string roleName = string.Empty; foreach (Sys_UserInRole uir in list1) { Sys_Role r = _roleRepository.Find(_applicationName, uir.RoleName); result.Add(r); } return(result); }
public override string[] GetRolesForUser(string username) { string tmpRoleNames = ""; IList <Sys_UserInRole> list = _urRepository.GetRolesForUser(ApplicationName, username); foreach (Sys_UserInRole ur in list) { tmpRoleNames += ur.RoleName + ","; } if (tmpRoleNames.Length > 0) { // Remove trailing comma. tmpRoleNames = tmpRoleNames.Substring(0, tmpRoleNames.Length - 1); return(tmpRoleNames.Split(',')); } return(new string[0]); }