Sha256: 44d96bab90ecec6371389f00c685031ddde3321ac9b5a241db25dc5f794717fb

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

module Conjur::DSL2::Executor
  # Permit a privilege with a POST request to the +permit+ url of the resource, with the privilege
  # and role as parameters. +grant_option+ is also provided if it is explicitly stated on the Permit
  # record.
  class Permit < Base
    def execute
      parameters = { "privilege" => statement.privilege, "role" => statement.role.role.roleid(default_account) }
      parameters['grant_option'] = admin unless statement.role.admin.nil?
      action({
        'method' => 'post',
        'path' => "#{resource_path(statement.resource)}?permit",
        'parameters' => parameters
      })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conjur-asset-dsl2-0.3.0 lib/conjur/dsl2/executor/permit.rb