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>
13 lines
489 B
SQL
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'));
|