Пример #1
0
        /// <summary>
        /// 通过指定登录名获取授权角色名称数据集合
        /// </summary>
        /// <param name="userName">登录名</param>
        /// <returns></returns>
        public override IEnumerable <string> RetrievesByUserName(string userName)
        {
            var user = UserHelper.RetrieveUserByUserName(userName) as User;

            return(user == null ? new string[0] : RoleHelper.Retrieves().Where(r => user.Roles.Any(ur => ur == r.Id)).Select(r => r.RoleName));
        }