/// <summary>
        /// 当前请求是否具有访问权限
        /// </summary>
        /// <param name="filterContext">
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        private bool HasPermission(AuthorizationContext filterContext)
        {
            if (string.IsNullOrEmpty(filterContext.HttpContext.User.Identity.Name))
            {
                // if login then return false
                return(false);
            }

            // 取当前用户的权限
            IEnumerable <ApplicationPermission> rolePermissions = this.GetUserPermissions(filterContext.HttpContext);

            // 待访问的Action的Permission
            var action = new ApplicationPermission
            {
                Action     = filterContext.ActionDescriptor.ActionName,
                Controller =
                    filterContext.ActionDescriptor.ControllerDescriptor
                    .ControllerName,
                Description =
                    ActionPermissionService.GetDescription(
                        filterContext.ActionDescriptor)
            };

            // 是否授权
            return(rolePermissions.Contains(action, new ApplicationPermissionEqualityComparer()));
        }
        /// <summary>
        /// 当前请求是否具有访问权限
        /// </summary>
        /// <param name="filterContext"></param>
        /// <returns></returns>
        private bool HasPermission(AuthorizationContext filterContext)
        {
            //取当前用户的权限
            var rolePermissions = GetUserPermissions(filterContext.HttpContext);
            //待访问的Action的Permission
            var action = new ApplicationPermission
            {
                Action      = filterContext.ActionDescriptor.ActionName,
                Controller  = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName,
                Description = ActionPermissionService.GetDescription(filterContext.ActionDescriptor)
            };

            //是否授权
            return(rolePermissions.Contains(action, new ApplicationPermissionEqualityComparer()));
        }