Ejemplo n.º 1
0
        /// <summary>
        /// 用户权限判断(string permissionRecordSystemName,User)
        /// </summary>
        /// <param name="permissionRecordSystemName">Permission record system name</param>
        /// <param name="account">Account</param>
        /// <returns>true - authorized; otherwise, false</returns>
        public virtual bool Authorize(string permissionRecordSystemName, User account)
        {
            if (String.IsNullOrEmpty(permissionRecordSystemName))
            {
                return(false);
            }
            if (_userService.AccountPermissionRecords(_workContext.CurrentUser).Any(p => p.SystemName == permissionRecordSystemName))
            {
                return(true);
            }

            return(false);
        }