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

Fixes #36663 - Add permission to modify LookupValue resource #9803

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

nofaralfasi
Copy link
Contributor

This is necessary when using gql to allow non-admin users to modify lookup-key values.

Required for:

@theforeman-bot
Copy link
Member

Issues: #36663

Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @nofaralfasi, tested with theforeman/foreman_ansible#633. The change in permission_list.rb is enough.

Some questions inline though:

app/registries/foreman/access_permissions.rb Outdated Show resolved Hide resolved
db/seeds.d/020-permissions_list.rb Outdated Show resolved Hide resolved
@ofedoren
Copy link
Member

Thanks, @nofaralfasi, but the test failure is related.

@nofaralfasi
Copy link
Contributor Author

I'm uncertain about the proper procedure for including these permissions.
As I understand it, if we're adding permissions exclusively used within the plugin, they should be included in the plugin's register.rb file. On the other hand, if the intention is to incorporate these permissions into the foreman core, we need to define them in the access_permissions.rb file as well, or they might not be generated.

@ofedoren
Copy link
Member

ofedoren commented Aug 29, 2023

Right, so this is actually my bad.

I see two ways to fix that:

  1. Easiest: just add these permissions to the ignore list for the test.
  2. Proper?: Create a new permission block :lookup_values with mapped permissions for the LookupValuesController, since we have at least that one in access_permissions.rb.

This is necessary when using gql to allow non-admin users
to modify lookup-key values.
Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @nofaralfasi, for bearing with me 🌹 LGTM, works and we're green.

@ofedoren ofedoren merged commit 48173f4 into theforeman:develop Aug 29, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants