Skip to content

Commit

Permalink
Fixes #36663 - Add permission to modify LookupValue resource
Browse files Browse the repository at this point in the history
This is necessary when using gql to allow non-admin users
to modify lookup-key values.

(cherry picked from commit 48173f4)
  • Loading branch information
nofaralfasi authored and ekohl committed Nov 11, 2023
1 parent 735620b commit 1b55bac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/registries/foreman/access_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -639,4 +639,11 @@
map.permission :edit_settings, { :settings => [:update],
:'api/v2/settings' => [:update] }
end

permission_set.security_block :lookup_values do |map|
map.permission :view_lookup_values, {:lookup_values => [:index]}
map.permission :create_lookup_values, {:lookup_values => [:create]}
map.permission :edit_lookup_values, {:lookup_values => [:update]}
map.permission :destroy_lookup_values, {:lookup_values => [:destroy]}
end
end
4 changes: 4 additions & 0 deletions db/seeds.d/020-permissions_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def permissions
['Location', 'edit_locations'],
['Location', 'destroy_locations'],
['Location', 'assign_locations'],
['LookupValue', 'view_lookup_values'],
['LookupValue', 'create_lookup_values'],
['LookupValue', 'edit_lookup_values'],
['LookupValue', 'destroy_lookup_values'],
['MailNotification', 'view_mail_notifications'],
['MailNotification', 'edit_user_mail_notifications'],
['Medium', 'view_media'],
Expand Down

0 comments on commit 1b55bac

Please sign in to comment.