Sha256: f7eeea03b47964462962f0f0030f64c2f11779179f8507991101b149d0d4dca6

Contents?: true

Size: 863 Bytes

Versions: 5

Compression:

Stored size: 863 Bytes

Contents

module Conjur::Policy::Types
  class Create < Base
    attribute :record

    self.description = %(
Create a record of any type.

A record can be a [Role](#reference/role) or a [Resource](#reference/resource).

Creating records can be done explicitly using this node type, or
implicitly. Examples of both are given immeditely below.
)

    self.example = %(
- !user research # implicit record creation
- !create        # explicit record creation
    record: !user research
- !create
    record: !group experiment
- !create
    record: !role control
      kind: experimental_control
      owner: !user research
)
        
    def to_s
      messages = [ "Create #{record}" ]
      if record.resource?
        (record.annotations||{}).each do |k,v|
          messages.push "  Set annotation '#{k}'"
        end
      end
      messages.join("\n")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
conjur-asset-policy-0.8.3 lib/conjur/policy/types/create.rb
conjur-asset-policy-0.8.2 lib/conjur/policy/types/create.rb
conjur-asset-policy-0.8.1 lib/conjur/policy/types/create.rb
conjur-asset-policy-0.8.0 lib/conjur/policy/types/create.rb
conjur-asset-policy-0.7.1 lib/conjur/policy/types/create.rb