fix: separate platform staff from tenant roles (#94)#102
Merged
Conversation
Tenant membership roles and Django/Wagtail system staff were effectively conflated, which allowed tenant admins to reach platform surfaces (e.g. platform audit log) and blurred owner vs admin semantics. Backend - Enforce distinct platform vs tenant capabilities in API permissions, serializers, and tenant services. - Add tenant role validation (coordinator role, constraints) so owner/admin overlap and invalid combinations are rejected at the model/service layer. - Restrict compliance/platform audit API access to appropriate system staff; keep tenant-scoped audit behavior aligned with membership. - Refresh seeders: platform user seeding, tenant user seeding, and seed command wiring; document test users under docs/TEST_USERS.md. Frontend - Harden auth guard and auth store; add no-organization flow for users without tenant membership. - Gate settings routes (billing, invitations, platform audit log, platform users) and sidebar entries by platform vs tenant context. - Add platform Wagtail notice page where Wagtail-only actions apply; extend locales and settings types. - Add/update tests for auth guard and dashboard. Migrations & housekeeping - Consolidate/squash initial migrations (home, inventory, procurement, sales, tenants) into cleaner 0001/0002 sequences where applicable. - Update ARCHITECTURE, CHANGELOG, and API/touch tests across audit, auth, bulk, jobs, tenant, inventory, and seeders. Fixes #94
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Tenant membership roles and Django/Wagtail system staff were effectively conflated, which allowed tenant admins to reach platform surfaces (e.g. platform audit log) and blurred owner vs admin semantics.
Backend
Frontend
Migrations & housekeeping
Fixes #94