/// <summary> /// 权限中间件构造 /// </summary> /// <param name="next">管道代理对象</param> /// <param name="permissionResitory">权限仓储对象</param> /// <param name="option">权限中间件配置选项</param> public PermissionMiddleware(RequestDelegate next, PermissionMiddlewareOption option, ICustomerService customerService) { _option = option; _next = next; _userPermissions = option.UserPerssions; _customerService = customerService; }
public static IApplicationBuilder UsePermission(this IApplicationBuilder builder, PermissionMiddlewareOption option) { return(builder.UseMiddleware <PermissionMiddleware>(option)); }