Skip to content

fix: separate platform staff from tenant roles (#94)#102

Merged
Ndevu12 merged 1 commit intomainfrom
fix/94-system-tenant-role-separation
Mar 25, 2026
Merged

fix: separate platform staff from tenant roles (#94)#102
Ndevu12 merged 1 commit intomainfrom
fix/94-system-tenant-role-separation

Conversation

@Ndevu12
Copy link
Copy Markdown
Owner

@Ndevu12 Ndevu12 commented Mar 25, 2026

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

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
@Ndevu12 Ndevu12 added enhancement New feature or request fix Pull requests that fix some issues labels Mar 25, 2026
@Ndevu12 Ndevu12 self-assigned this Mar 25, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
the-inventory Ready Ready Preview, Comment Mar 25, 2026 2:21pm
the-inventory-ui Ready Ready Preview, Comment Mar 25, 2026 2:21pm

@Ndevu12 Ndevu12 merged commit 18257a7 into main Mar 25, 2026
7 of 9 checks passed
@Ndevu12 Ndevu12 deleted the fix/94-system-tenant-role-separation branch March 25, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fix Pull requests that fix some issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: system and tenant roles are conflicting!

1 participant