class Conjur::Policy::Planner::Policy

Public Instance Methods

do_plan() click to toggle source
# File lib/conjur/policy/planner/record.rb, line 45
def do_plan
  unless record.body.nil?
    error('Not expecting a body element in policy')
  end
  
  # Create the role
  Role.new(record.role, api).tap do |role|
    role.plan = plan
    role.do_plan
  end

  # Copy the annotations
  Hash(record.annotations).each do |k,v|
    record.resource.annotations ||= {}
    record.resource.annotations[k] = v
  end

  # Create the resource
  Resource.new(record.resource, api).tap do |resource|
    resource.plan = plan
    resource.do_plan
  end
end