feat(rbac): roles and api guards#746
Open
thornsberrysara wants to merge 3 commits into
Open
Conversation
Seed developer and viewer built-in roles, document the permission matrix in docs/rbac.md, and protect built-in roles from deletion in the UI.
…APIs Apply PermissionsGuard to build, repository, and cluster helper endpoints. Git provider webhooks remain unauthenticated for external delivery.
…tifications Secure previously unguarded read/write routes with JwtAuthGuard and PermissionsGuard aligned with existing config and app permission checks.
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.
Description
Kubero already had roles, permissions, and JWT-based checks in parts of the UI and API, but the role model was incomplete and several API routes were not consistently protected. This PR implements the RBAC model described in #545 by adding two new built-in roles and tightening API enforcement.
Summary of changes:
docs/rbac.mddocumenting roles, permissions, teams vs. roles, and how enforcement works.admin,member,developer,viewer,guest) cannot be deleted from Accounts → Roles; English locale hints for built-in roles.PermissionsGuardadded or extended on controllers that were missing or inconsistently guarded:config:read/config:write)Motivation: Issue #545 calls for clearer, enforceable roles beyond admin/member/guest. Without API guards on all sensitive routes, permission checks in the UI could be bypassed. The notifications API in particular was a gap.
Dependencies: None. No operator or CLI changes required.
Fixes #545
Type of change
How Has This Been Tested?
Manual test plan (reproducible locally):
npm run start:devinserver/), build client (npm run buildinclient/).devtest(developer) andviewtest(viewer), assign admin team for pipeline visibility.GET /api/usersandGET /api/notificationsreturn 403; as admin return 200.Test Configuration:
Checklist:
Note for reviewers: Permissions are embedded in the JWT at login — users must log out and back in after a role change to pick up new permissions. Repo webhook routes remain unauthenticated by design (external Git providers).