Sha256: f3fbe14b7a3a9b3b58ae7914714140fb0fc8267bbe15adf1084572f0e8366ec8

Contents?: true

Size: 649 Bytes

Versions: 2

Compression:

Stored size: 649 Bytes

Contents

module Conjur
  module DSL2
    module Types
      class Permit < Base
        attribute :role, kind: :member
        attribute :privilege, kind: :string, dsl_accessor: true
        attribute :resource, dsl_accessor: true
        attribute :replace, kind: :boolean, singular: true, dsl_accessor: true
        
        include ResourceMemberDSL
        
        def initialize privilege = nil
          self.privilege = privilege
        end
        
        def to_s
          "Permit #{role.role} to [#{Array(privilege).join(', ')}] on #{Array(resource).join(', ')}#{role.admin ? ' with grant option' : ''}"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
conjur-asset-dsl2-0.4.4 lib/conjur/dsl2/types/permit.rb
conjur-asset-dsl2-0.4.3 lib/conjur/dsl2/types/permit.rb