1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // <author></author>
- // <date></date>
- // <description></description>
- using ERP.Framework.Constants;
- using ERP.Framework.Security;
- using Microsoft.AspNetCore.Mvc.Filters;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ERP.Framework.Attribute
- {
- /// <summary>
- /// 接口权限特性
- /// </summary>
- [AttributeUsage(AttributeTargets.Method)]
- public class PermissionAttribute : ActionFilterAttribute
- {
- //internal string Code { get; set; }
- //public PermissionAttribute(string code)
- //{
- // Code = code;
- //}
- //public override void OnActionExecuted(ActionExecutedContext context)
- //{
- // var loginUser = LoginHelper.GetLoginUser();
- // if (loginUser.Permission.Contains(FrameworkConstant.AdminPermission))
- // {
- // return;
- // }
- // if (!loginUser.Permission.Contains(this.Code))
- // {
- // throw new Exception(AuthI18N.NoPermission);
- // }
- //}
- }
- }
|