Disabled orgs are still granted permissions through the Check API
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 344
- Forks
- 47
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 26
Description
The disabled-org gate added in #1860 covers the management and resource RPCs (the authorization map), but the SpiceDB Check API is deliberately out of its scope:
CheckResourcePermissionBatchCheckPermissionCheckFederatedResourcePermission
These are on the authorization skip list and answer purely from SpiceDB tuples. Because disabling an org leaves its tuples in place (by design, so re-enable restores access), these endpoints keep returning allowed = true for resources of a disabled org. External services that gate their own access on these checks will keep serving a disabled org's resources.
Two ways to close it
- Handler/service guard (Postgres read): resolve each checked resource to its org and return
falsewhen the org is disabled. Simple, no migration, but adds 1–3 point reads per check on a hot path, and overloads "denied" to also mean "suspended". - SpiceDB marker relation (preferred): add a
suspendedrelation on the org that every permission subtracts (- org->suspended); write the tuple on disable, remove it on enable. Reflects org state in every check — single, batch, and federated — with no extra Postgres reads, since it rides the existing permission traversal. Requires a schema migration, disable/enable flow changes, and a backfill for currently-disabled orgs. Care needed so platform/superuser permissions are not subtracted (admins must still manage and re-enable).
Recommendation: option 2.
Relates to #1585.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing CheckResourcePermission, BatchCheckPermission, and CheckFederatedResourcePermission, then follow the existing disable and enable flows and authorization schema. Implement the recommended SpiceDB suspended relation, including schema migration, tuple updates, and a backfill for currently disabled organizations. Done means all three checks deny disabled-org resources while platform and superuser permissions still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, postgres
- Domain
- api, authorization, database, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100