fix: persist custom roles immediately, show them in user modal
- createRole() now calls api.rolePermissions.save() on creation so the role survives a page refresh (was only in local state before) - UserModal now renders custom roles from savedPermissions context alongside the system role buttons - mapRole() passes custom_* role keys through unchanged - handleSave falls back to u.role for custom roles (no backendRoleMap entry) - Table badge handles missing ROLE_META entry for custom roles - DB migration 082: removes users.role CHECK constraint so custom role keys can be stored in the users table - Backend POST/PATCH: allow custom_* roles through role allowlist checks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2
backend/migrations/082_users_custom_roles.sql
Normal file
2
backend/migrations/082_users_custom_roles.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Remove role CHECK constraint so custom role keys (e.g. custom_123) can be stored
|
||||
ALTER TABLE users DROP CONSTRAINT IF EXISTS users_role_check;
|
||||
Reference in New Issue
Block a user