fix/authz-role-checks #352

Closed
vkobel wants to merge 2 commits from refs/pull/352/head into main
vkobel commented 2026-07-02 09:55:59 +00:00 (Migrated from codeberg.org)

Several write handlers only checked that the user belonged to the org, not their role — so a Viewer/Member could delete apps, manage cloud credentials, change billing, cancel the subscription, and provision resources.

This gates every state-changing endpoint on role:

  • Admin/owner required: delete resource, cloud credential create/delete/set-default, payment-method delete/set-primary, auto-topup, subscribe / change-tier / cancel subscription, builder config.
  • Viewer blocked (member allowed): deploy, create resource.

Subscription handlers now authorize before validating the tier, so non-admins get 403 rather than leaking tier validity.

Also fixes an unrelated pre-existing test-compile break (missing PLATFORM_REPO import) that blocked make test-unit.

Testing: New tests/e2e/test_authz_roles.sh (make test-e2e-authz-roles) — 14/14 steps pass, exercising viewer/member/owner against every gated endpoint.

Several write handlers only checked that the user belonged to the org, not their role — so a Viewer/Member could delete apps, manage cloud credentials, change billing, cancel the subscription, and provision resources. This gates every state-changing endpoint on role: - Admin/owner required: delete resource, cloud credential create/delete/set-default, payment-method delete/set-primary, auto-topup, subscribe / change-tier / cancel subscription, builder config. - Viewer blocked (member allowed): deploy, create resource. Subscription handlers now authorize before validating the tier, so non-admins get 403 rather than leaking tier validity. Also fixes an unrelated pre-existing test-compile break (missing PLATFORM_REPO import) that blocked make test-unit. Testing: New tests/e2e/test_authz_roles.sh (make test-e2e-authz-roles) — 14/14 steps pass, exercising viewer/member/owner against every gated endpoint.
vkobel commented 2026-07-07 07:29:37 +00:00 (Migrated from codeberg.org)

will be part of a future refactor

will be part of a future refactor

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
public/platform!352
No description provided.