Implement account management features in API, including endpoints for listing accounts and updating account roles. Introduce moderator role with associated permissions, and refactor access control checks to accommodate staff roles. Update database schema to support new role constraints and enhance frontend navigation for staff access.
This commit is contained in:
10
backend/migrations/009_moderator_role.sql
Normal file
10
backend/migrations/009_moderator_role.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- +mixmaker Up
|
||||
ALTER TABLE accounts
|
||||
DROP CONSTRAINT IF EXISTS accounts_role_check,
|
||||
ADD CONSTRAINT accounts_role_check CHECK (role IN ('admin', 'moderator', 'player'));
|
||||
|
||||
-- +mixmaker Down
|
||||
UPDATE accounts SET role = 'player' WHERE role = 'moderator';
|
||||
ALTER TABLE accounts
|
||||
DROP CONSTRAINT IF EXISTS accounts_role_check,
|
||||
ADD CONSTRAINT accounts_role_check CHECK (role IN ('admin', 'player'));
|
||||
Reference in New Issue
Block a user