Sha256: f6c7ee08f6e63492a85777711575d8bdf4fa54486d98686934e24e6613d48a60

Contents?: true

Size: 937 Bytes

Versions: 4

Compression:

Stored size: 937 Bytes

Contents

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

    self.description = %(
Make explicit changes to an existing record's attributes and/or annotations.

For example, you can change annotations on a [Resource](#reference/resource), or the `uidnumber` of a [User](#reference/user).
    
Generally, Update is not used explicitly. Instead, an update is performed by the create-or-replace behavior of
statements such as User, Group, Host, Layer, etc.
)

    self.example = %(
- !user wizard
    annotations:
      color: gray

- !update
    record: !user wizard
      annotations:
        color: white
)
    
    def to_s
      messages = [ "Update #{record}" ]
      (record.custom_attribute_names||[]).each do |k|
        messages.push "  Set field '#{k}'" 
      end
      (record.annotations||{}).each do |k,v|
        messages.push "  Set annotation '#{k}'"
      end
      messages.join("\n")
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
conjur-policy-parser-0.12.0 lib/conjur/policy/types/update.rb
conjur-asset-policy-0.13.0 lib/conjur/policy/types/update.rb
conjur-asset-policy-0.12.0 lib/conjur/policy/types/update.rb
conjur-asset-policy-0.11.0 lib/conjur/policy/types/update.rb