Module: Trailblazer::V1_1::Operation::Policy::DSL

Defined in:
lib/trailblazer/1.1/operation/policy.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(extender) ⇒ Object



14
15
16
17
# File 'lib/trailblazer/1.1/operation/policy.rb', line 14

def self.extended(extender)
  extender.inheritable_attr :policy_config
  extender.policy_config = lambda { |*| true } # return true per default.
end

Instance Method Details

#permission_classObject



23
24
25
# File 'lib/trailblazer/1.1/operation/policy.rb', line 23

def permission_class
  Permission
end

#policy(*args, &block) ⇒ Object



19
20
21
# File 'lib/trailblazer/1.1/operation/policy.rb', line 19

def policy(*args, &block)
  self.policy_config = permission_class.new(*args, &block)
end