Skip to content

feat(access): turn CBAC denials into a real Permission Denied page, port sudo to V2 - #1018

Merged
japsu merged 1 commit into
mainfrom
feat/sudo
Aug 27, 2026
Merged

feat(access): turn CBAC denials into a real Permission Denied page, port sudo to V2#1018
japsu merged 1 commit into
mainfrom
feat/sudo

Conversation

@japsu

@japsu japsu commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

A denied V2 GraphQL request used to surface as the generic "Something went
wrong!" crash page, and leaked internal app/model/field claims into the
error message since CBACPermissionDenied carried no real message or
extensions. Give it extensions.code/claims (superuser-only) instead, add a
matching NOT_FOUND code for unguarded ObjectDoesNotExist, and branch on both
in apolloClient so the frontend renders a translated forbidden()/notFound()
page instead of crashing.

Also port V1's superuser sudo override (sudo_view.py) to V2: a shared
grant_sudo() plus a sudoCbac mutation let a superuser confirm a temporary
CBAC entry from a /sudo page reached via the denial, mirroring 403.pug's
confirm-then-grant flow rather than V1's own auto-grant.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

…ort sudo to V2

A denied V2 GraphQL request used to surface as the generic "Something went
wrong!" crash page, and leaked internal app/model/field claims into the
error message since CBACPermissionDenied carried no real message or
extensions. Give it extensions.code/claims (superuser-only) instead, add a
matching NOT_FOUND code for unguarded ObjectDoesNotExist, and branch on both
in apolloClient so the frontend renders a translated forbidden()/notFound()
page instead of crashing.

Also port V1's superuser sudo override (sudo_view.py) to V2: a shared
grant_sudo() plus a sudoCbac mutation let a superuser confirm a temporary
CBAC entry from a /sudo page reached via the denial, mirroring 403.pug's
confirm-then-grant flow rather than V1's own auto-grant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@japsu
japsu merged commit d9ee5ee into main Aug 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant