Sha256: b29f2d0742bbabdd94ed0379e1edcb390a318e7d56249ae33d4a2c5347208845
Contents?: true
Size: 523 Bytes
Versions: 61
Compression:
Stored size: 523 Bytes
Contents
# frozen_string_literal: true default_permissions = Foreman::Plugin.find("foreman_discovery").default_roles ["Discovery Reader", "Discovery Manager"].each do |role_name| Role.ignore_locking do role = Role.unscoped.find_by_name(role_name) || next default_permissions[role_name].each do |permission| role.add_permissions(permission) unless role.permission_names.include?(permission.to_sym) end role.origin = 'discovery' role.description = 'Discovery plugin built-in role' role.save end end
Version data entries
61 entries across 61 versions & 1 rubygems