| | |
| | | Type controllerType = controllerDescriptor.ControllerType; |
| | | // // 获取控制器级别标签 |
| | | var controllerAttr = controllerType.GetCustomAttribute<PermissionAttribute>(); |
| | | // |
| | | // 获取动作级别标签 |
| | | var actionAttr = actionContext.ActionDescriptor |
| | | .GetCustomAttributes<PermissionAttribute>() |
| | | .FirstOrDefault(); |
| | |
| | | } |
| | | } |
| | | |
| | | }else if (string.IsNullOrWhiteSpace(actionAttr.HModName) && string.IsNullOrWhiteSpace(actionAttr.Operate)) |
| | | { |
| | | // 单独在动作上启用鉴权功能 |
| | | PermissionStr = actionAttr.HModName + actionAttr.Operate; |
| | | |
| | | if (!string.IsNullOrWhiteSpace(PermissionStr)) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log(PermissionStr, 1, false, JWTHelper.getUserName(token))) |
| | | { |
| | | HandleForbidden(actionContext); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |