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

Bug fix: Add global field when updating a role. #337

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

vtorosyan
Copy link
Contributor

@vtorosyan vtorosyan commented Jan 13, 2022

When updating a fine-grained access control role, Grafana checks if the role at question has global scope or not.
If global field is not specified in the role definition, Grafana will always assume that the role is not global,
which will result to failure when updating global roles.

Note for the reviewers

The role update is a Grafana Enterprise feature, these code lines are the guardians which will cause the failure without the global flat set correctly.

When updating a fine-grained access control role, Grafana checks if the role at question has global scope or not.
If global field is not specified in the role definition, Grafana will always assume that the role is not global,
which will result to failure when updating global roles.
@vtorosyan vtorosyan added the bug label Jan 13, 2022
@vtorosyan vtorosyan requested a review from a team as a code owner January 13, 2022 12:26
Copy link
Member

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

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

Seems like the current tests should already cover this case but I actually don't know how to run them 😬 . I really have to get #294 done

@Jguer
Copy link
Contributor

Jguer commented Jan 13, 2022

Have run the tests, the one that covers this fails in the main branch, passes in this one 👍

@julienduchesne julienduchesne merged commit a23cbed into master Jan 13, 2022
@julienduchesne julienduchesne deleted the vt/role_update_fix branch January 13, 2022 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants