From 04282ec24c79fda10cca011dee288a4a9cba980c Mon Sep 17 00:00:00 2001 From: Bastian Schmidt Date: Fri, 6 Dec 2024 11:44:57 +0100 Subject: [PATCH] Remove prefix on permissions --- lib/foreman_resource_quota/register.rb | 28 ++++++++++++-------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/foreman_resource_quota/register.rb b/lib/foreman_resource_quota/register.rb index 9e89589..b3a51cf 100644 --- a/lib/foreman_resource_quota/register.rb +++ b/lib/foreman_resource_quota/register.rb @@ -10,24 +10,22 @@ # 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], + :'api/v2/resource_quotas' => [:index :show :utilization :missing_hosts :hosts :users :usergroups + :auto_complete_search] }, + 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], + :'api/v2/resource_quotas' => [:create] }, + 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], + :'api/v2/resource_quotas' => [:update] }, + 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