lib/critic/authorization.rb in critic-0.1.1 vs lib/critic/authorization.rb in critic-0.2.0
- old
+ new
@@ -1,13 +1,14 @@
# frozen_string_literal: true
class Critic::Authorization
attr_reader :policy, :action
- attr_accessor :messages, :granted, :result
+ attr_accessor :messages, :granted, :result, :metadata
def initialize(policy, action)
@policy = policy
- @action = action
+ @action = action&.to_sym
+ @metadata = {}
@granted, @result = nil
@messages = []
end
def granted?