Add business team access controls and customer role filters.

Super-admins can assign Admin; owners/admins manage Editor/Viewer via team/access, and the customers list supports all/customers/managers filtering.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-10 21:31:28 +03:30
co-authored by Cursor
parent 2c4d02bd0e
commit e59db25814
8 changed files with 334 additions and 12 deletions
+4
View File
@@ -17,6 +17,10 @@ Content resources: `products.*`, `categories.*`, `media.*`, `business.team.*`
- `super_admin` → all permissions (bypasses business guard)
- Business owner (`isOwner=true`) → `business_owner` role permissions
- Team member → permissions from `business_users.role_id` (admin/editor/viewer)
- Team **admin** may invite/update/remove **non-admin** staff only (cannot change or assign other admins)
- Team **editor** / **viewer** have no `business.team.*` manage permissions
- Only **super_admin** may assign or change the `admin` team role (owners/admins may assign editor/viewer)
- Owners cannot be changed via team APIs; use `PATCH .../team/access` for customer vs manager (staff)
## Adding a business-scoped endpoint