Files
online-backend/db/migrations/20260831172100_role_guard_names.up.sql
T
guwandykandCursor 28509eb4ca
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled
Add backups, currencies and dashboard APIs, and scope access by guard_name.
Web users may only CRUD their own records, operators stay in assigned branches, and admin/manager/superadmin keep full access.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-31 18:14:47 +05:00

8 lines
371 B
SQL

-- Guard enforces API access by roles.guard_name:
-- web = customer (own data)
-- operator = branch staff
-- admin = admin / manager / superadmin
UPDATE roles SET guard_name = 'web' WHERE code = 'user';
UPDATE roles SET guard_name = 'operator' WHERE code = 'operator';
UPDATE roles SET guard_name = 'admin' WHERE code IN ('admin', 'superadmin', 'manager');