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

Fix bug possible to override project rbac built-in roles #4921

Merged
merged 1 commit into from
May 23, 2024

Conversation

khanhtc1202
Copy link
Member

@khanhtc1202 khanhtc1202 commented May 22, 2024

What this PR does / why we need it:

As a spec, we don't allow users to update the project built-in RBAC roles. This PR changes the UpdateRBACRoles logic to ensure that.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.29%. Comparing base (b1177ab) to head (985afc7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4921   +/-   ##
=======================================
  Coverage   29.29%   29.29%           
=======================================
  Files         321      321           
  Lines       40835    40835           
=======================================
  Hits        11964    11964           
  Misses      27913    27913           
  Partials      958      958           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t-kikuc t-kikuc added the kind/bug Something isn't working label May 22, 2024
Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

I understood what you did and it worked well.

[ASK] Is there any way to update built-in roles from UI now? (hacking DOM?)
(just asking, not a problem)

@khanhtc1202
Copy link
Member Author

I understood what you did and it worked well.

[ASK] Is there any way to update built-in roles from UI now? (hacking DOM?)

(just asking, not a problem)

Basically, it's just UI lock, mean we disable the edit button for built-in roles' policies. Not sure about your mentioned hacking DOM, but since there is no lock on server side, simply send a request to the update RBAC roles endpoint with updated built-in roles data will override it 👀

@t-kikuc
Copy link
Member

t-kikuc commented May 23, 2024

@khanhtc1202 Thanks, I got it.

Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

Great detection, thanks 🚀

Copy link
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

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

LGTM 🙆‍♂️

@khanhtc1202 khanhtc1202 merged commit 9a7b9a3 into master May 23, 2024
14 checks passed
@khanhtc1202 khanhtc1202 deleted the fix-update-project-rbac-roles branch May 23, 2024 02:43
@github-actions github-actions bot mentioned this pull request Jun 12, 2024
@github-actions github-actions bot mentioned this pull request Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/go kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants