fix(auth): implement cluster-specific role filtering in frontend UI#2422
Open
mbaurin wants to merge 1 commit into
Open
fix(auth): implement cluster-specific role filtering in frontend UI#2422mbaurin wants to merge 1 commit into
mbaurin wants to merge 1 commit into
Conversation
5d6e365 to
fa2170c
Compare
fa2170c to
d63f543
Compare
|
Hello, when trying to access the AKHQ instance. It looks like the problem with this piece of code https://github.com/mbaurin/akhq/blob/d63f543426ca8ff91a5d986530caf7804fde2a9c/client/src/utils/AkhqRoutes.jsx#L143 Am I missing something? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @tchiotludo,
This PR fixes a critical UX issue in the frontend where cluster-specific permissions were not properly enforced in the UI, leading to confusing user experiences where admin buttons appeared on read-only clusters.
Problem
Users with different permission levels across clusters (e.g., admin on qa-kafka but read-only on pre-kafka) were seeing admin UI elements on ALL clusters. When they clicked admin buttons on read-only clusters, they received confusing "permission denied" errors. The backend correctly enforced permissions, but the frontend ignored cluster restrictions.
Root Cause
The organizeRoles() function in client/src/utils/converters.js:114-133 was aggregating ALL permissions across ALL clusters without considering the clusters configuration from each role, causing the frontend to show maximum permissions everywhere.
Solution
backend AuthUser.AuthPermissions objects
cluster pattern matching
components with cluster-specific permission validation
and edge cases
Key Changes
Testing
User Experience After Fix
Closes #2366