lib/rails/auth/acl/middleware.rb in rails-auth-2.1.4 vs lib/rails/auth/acl/middleware.rb in rails-auth-2.2.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Rails
module Auth
class ACL
# Authorizes requests by matching them against the given ACL
class Middleware
@@ -23,9 +25,10 @@
def call(env)
unless Rails::Auth.authorized?(env)
matcher_name = @acl.match(env)
raise NotAuthorizedError, "unauthorized request" unless matcher_name
+
Rails::Auth.set_allowed_by(env, "matcher:#{matcher_name}")
end
@app.call(env)
end