Example #1
0
 /// <summary>
 /// 引入权限中间件
 /// </summary>
 /// <param name="builder">扩展类型</param>
 /// <param name="option">权限中间件配置选项</param>
 /// <returns></returns>
 public static IApplicationBuilder UsePermission(
     this IApplicationBuilder builder, PermissionOption option)
 {
     return(builder.UseMiddleware <PermissionUserUrlMiddleware>(option));
 }
Example #2
0
 /// <summary>
 /// 权限中间件构造
 /// </summary>
 /// <param name="next">管道代理对象</param>
 /// <param name="permissionResitory">权限仓储对象</param>
 /// <param name="option">权限中间件配置选项</param>
 public PermissionUserUrlMiddleware(RequestDelegate next, PermissionOption option)
 {
     _option          = option;
     _next            = next;
     _userPermissions = option.UserPerssions;
 }