public static IAppBuilder UseResourceAuthorization(this IAppBuilder app, IResourceAuthorizationManager authorizationManager)
        {
            var options = new ResourceAuthorizationMiddlewareOptions
            {
                Manager = authorizationManager
            };

            app.UseResourceAuthorization(options);
            return app;
        }
 public ResourceAuthorizationManagerMiddleware(Func<IDictionary<string, object>, Task> next, ResourceAuthorizationMiddlewareOptions options)
 {
     _options = options;
     _next = next;
 }
 public static IAppBuilder UseResourceAuthorization(this IAppBuilder app, ResourceAuthorizationMiddlewareOptions options)
 {
     app.Use(typeof(ResourceAuthorizationManagerMiddleware), options);
     return app;
 }
 public ResourceAuthorizationManagerMiddleware(Func <IDictionary <string, object>, Task> next, ResourceAuthorizationMiddlewareOptions options)
 {
     _options = options;
     _next    = next;
 }