Sha256: 29dbca6d671efc90ecdd1b11f8170f9698a05a1648c349f9ba6227cddbd81a53

Contents?: true

Size: 749 Bytes

Versions: 9

Compression:

Stored size: 749 Bytes

Contents

module Conjur
  module DSL2
    module Types
      class Grant < Base
        attribute :role, dsl_accessor: true
        attribute :member
        attribute :replace, kind: :boolean, singular: true, dsl_accessor: true
        
        include RoleMemberDSL
        include ManagedRoleDSL
        
        def to_s
          role_str = role.kind_of?(Array) ?
            role.join(', ') : role
          member_str = member.kind_of?(Array) ?
            member.map(&:role).join(', ') : member.role
          admin = member.kind_of?(Array) ?
            member.map(&:admin).all? : member.admin
          "Grant #{role_str} to #{member_str}#{replace ? ' exclusively ' : ''}#{admin ? ' with admin option' : ''}"
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
conjur-asset-dsl2-0.6.1 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.6.0 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.5.0 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.4.4 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.4.3 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.4.2 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.3.2 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.3.1 lib/conjur/dsl2/types/grant.rb
conjur-asset-dsl2-0.3.0 lib/conjur/dsl2/types/grant.rb