Sha256: 95cd7f7e55a70a640964ff07bd8da9f377f4c2527ab1fb5e7a56bab7a32da73f

Contents?: true

Size: 514 Bytes

Versions: 3

Compression:

Stored size: 514 Bytes

Contents

# Add permissions
Foreman::AccessControl.map do |map|
  map.security_block :bootdisk do |map|
    map.permission :download_bootdisk, {:hosts => [:bootdisk_iso],
                                        :'bootdisk/disks' => [:generic_iso, :index]}
  end
end

begin
  # Add a new role called 'Boot disk access' if it doesn't exist
  Role.transaction do
    role = Role.find_or_create_by_name("Boot disk access")
    role.update_attribute :permissions, [:download_bootdisk] if role.permissions.empty?
  end
rescue
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_bootdisk-1.2.3 config/initializers/bootdisk_permissions.rb
foreman_bootdisk-1.2.2 config/initializers/bootdisk_permissions.rb
foreman_bootdisk-1.2.1 config/initializers/bootdisk_permissions.rb