Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove prefix on permissions #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions lib/foreman_resource_quota/register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,25 @@
# Add permissions
security_block :foreman_resource_quota do
permission :view_resource_quotas,
{ 'foreman_resource_quota/resource_quotas': %i[index welcome auto_complete_search],
'foreman_resource_quota/api/v2/resource_quotas': %i[index show utilization missing_hosts hosts users usergroups
auto_complete_search],
'foreman_resource_quota/api/v2/resource_quotas/:resource_quota_id/': %i[utilization missing_hosts hosts users
usergroups] },
resource_type: 'ForemanResourceQuota::ResourceQuota'
{ :resource_quotas => [:index :welcome :auto_complete_search],

Check failure on line 13 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tCOLON (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
:'api/v2/resource_quotas' => [:index :show :utilization :missing_hosts :hosts :users :usergroups

Check failure on line 14 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tASSOC (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
:auto_complete_search] },

Check failure on line 15 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tRBRACK (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
resource_type: 'ResourceQuota'
permission :create_resource_quotas,
{ 'foreman_resource_quota/resource_quotas': %i[new create],
'foreman_resource_quota/api/v2/resource_quotas': %i[create] },
resource_type: 'ForemanResourceQuota::ResourceQuota'
{ :resource_quotas => [:new :create],

Check failure on line 18 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tCOLON (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
:'api/v2/resource_quotas' => [:create] },

Check failure on line 19 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tASSOC (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Check failure on line 19 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tRCURLY (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
resource_type: 'ResourceQuota'
permission :edit_resource_quotas,
{ 'foreman_resource_quota/resource_quotas': %i[edit update],
'foreman_resource_quota/api/v2/resource_quotas': %i[update] },
resource_type: 'ForemanResourceQuota::ResourceQuota'
{ :resource_quotas => [:edit :update],

Check failure on line 22 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tCOLON (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
:'api/v2/resource_quotas' => [:update] },

Check failure on line 23 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tASSOC (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Check failure on line 23 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token tRCURLY (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
resource_type: 'ResourceQuota'
permission :destroy_resource_quotas,
{ 'foreman_resource_quota/resource_quotas': %i[destroy],
'foreman_resource_quota/api/v2/resource_quotas': %i[destroy] },
resource_type: 'ForemanResourceQuota::ResourceQuota'
{ :resource_quotas => [:destroy],
:'api/v2/resource_quotas' => [:destroy] },
resource_type: 'ResourceQuota'

# TODO: Evaluate whether host/user/usergroup permission extensions are necessary
end

Check failure on line 31 in lib/foreman_resource_quota/register.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Lint/Syntax: unexpected token kEND (Using Ruby 2.5 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

# Add a permissions to default roles (Viewer and Manager)
role 'Resource Quota Manager', %i[view_resource_quotas
Expand Down
Loading