RezinaLMS-BackEnd/db/migrations/000103_content_manager_staff_role.up.sql
Yared Yemane df4f4d8ade Limit staff team roles to Super Admin, Admin, and Content Manager.
Add CONTENT_MANAGER RBAC defaults, migration, and Super Admin-only team email invitations; restrict assignable team_member roles without changing platform user roles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 12:01:02 +03:00

13 lines
489 B
SQL

-- Staff team roles: Super Admin, Admin, Content Manager only.
INSERT INTO roles (name, description, is_system)
VALUES ('CONTENT_MANAGER', 'Content manager — admin panel content section only', true)
ON CONFLICT (name) DO NOTHING;
UPDATE team_members
SET team_role = 'ADMIN'
WHERE team_role NOT IN ('SUPER_ADMIN', 'ADMIN', 'CONTENT_MANAGER');
ALTER TABLE team_members
ADD CONSTRAINT team_members_team_role_check
CHECK (team_role IN ('SUPER_ADMIN', 'ADMIN', 'CONTENT_MANAGER'));