Module: Conjur::Policy::Executor

Defined in:
lib/conjur/policy/executor.rb,
lib/conjur/policy/executor.rb,
lib/conjur/policy/executor/base.rb,
lib/conjur/policy/executor/deny.rb,
lib/conjur/policy/executor/give.rb,
lib/conjur/policy/executor/grant.rb,
lib/conjur/policy/executor/create.rb,
lib/conjur/policy/executor/permit.rb,
lib/conjur/policy/executor/retire.rb,
lib/conjur/policy/executor/revoke.rb,
lib/conjur/policy/executor/update.rb

Defined Under Namespace

Modules: ActingAs, Annotate Classes: Base, Create, CreateHostFactory, CreateRecord, CreateResource, CreateRole, CreateVariable, CreateWebservice, Deny, Give, Grant, Permit, Retire, Revoke, Update

Class Method Summary collapse

Class Method Details

.class_for(action) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/conjur/policy/executor.rb', line 22

def class_for action
  if action.is_a?(Conjur::Policy::Types::Create)
    class_name = action.record.class.name.split("::")[-1]
    begin
      Conjur::Policy::Executor.const_get([ "Create", class_name ].join)
    rescue NameError
      Conjur::Policy::Executor::CreateRecord
    end
  else
    class_name = action.class.name.split("::")[-1]
    Conjur::Policy::Executor.const_get(class_name)
  end
end