feat(rbac): add GET /Permissions capability contract#147
Open
KinshukSS2 wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
@danistrigaro @ClaudioPrimerano @massimiliano-cannata For GET /Permissions, should the capability contract represent: 1.policy/RLS-derived intent (pg_policies), or current PR implements option (1): strict schema contract + auth hardening + policy-derived capability mapping. |
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.
Summary
Implements
GET /Permissionsto provide a stable backend capability contract for role-aware frontend rendering.What Changed
/Permissionsextra=forbid)401on malformed/missing identity)publicALL -> read/create/update/deletecommand mappingWhy
This is required by the RBAC proposal so frontend behavior is derived from backend truth instead of hardcoded role assumptions.
API Contract
GET /Permissions200:{ username, role, permissions }401: unauthorized/invalid token400: backend/query failuresValidation
pytest api/tests/test_permissions_endpoint.py -qpassed (7 passed)ALLcommand mapping testedpytest api/tests -qhas one unrelated existing failure inapi/tests/test_oauth_connection_leak.pyScope Notes
No DB migration and no frontend changes in this PR.
This PR currently represents policy-derived capability intent and does not attempt full DB effective privilege computation (
GRANT/REVOKE+ RLS).fix #146