Roles.constants.ts70 lines · main
| 1 | export const BRIVEN_ROLES = [ |
| 2 | 'anon', |
| 3 | 'service_role', |
| 4 | 'authenticated', |
| 5 | 'authenticator', |
| 6 | 'dashboard_user', |
| 7 | 'briven_admin', |
| 8 | 'briven_auth_admin', |
| 9 | 'briven_functions_admin', |
| 10 | 'briven_read_only_user', |
| 11 | 'briven_realtime_admin', |
| 12 | 'briven_replication_admin', |
| 13 | 'briven_storage_admin', |
| 14 | 'pgbouncer', |
| 15 | 'pgsodium_keyholder', |
| 16 | 'pgsodium_keyiduser', |
| 17 | 'pgsodium_keymaker', |
| 18 | 'pgtle_admin', |
| 19 | 'cli_login_postgres', |
| 20 | 'briven_etl_admin', |
| 21 | ] as const |
| 22 | |
| 23 | // [Joshen] This was originally in the Roles mobx store |
| 24 | // Just keeping it for now in case we need to differ it from ^ BRIVEN_ROLES |
| 25 | export const SYSTEM_ROLES = [ |
| 26 | 'postgres', |
| 27 | 'pgbouncer', |
| 28 | 'briven_admin', |
| 29 | 'briven_auth_admin', |
| 30 | 'briven_storage_admin', |
| 31 | 'dashboard_user', |
| 32 | 'authenticator', |
| 33 | 'pg_database_owner', |
| 34 | 'pg_read_all_data', |
| 35 | 'pg_write_all_data', |
| 36 | ] as const |
| 37 | |
| 38 | export const ROLE_PERMISSIONS = { |
| 39 | canLogin: { |
| 40 | disabled: false, |
| 41 | description: 'User can login', |
| 42 | grant_by_dashboard: true, |
| 43 | }, |
| 44 | canCreateRole: { |
| 45 | disabled: false, |
| 46 | description: 'User can create roles', |
| 47 | grant_by_dashboard: true, |
| 48 | }, |
| 49 | canCreateDb: { |
| 50 | disabled: false, |
| 51 | description: 'User can create databases', |
| 52 | grant_by_dashboard: true, |
| 53 | }, |
| 54 | canBypassRls: { |
| 55 | disabled: false, |
| 56 | description: 'User bypasses every row level security policy', |
| 57 | grant_by_dashboard: true, |
| 58 | }, |
| 59 | isSuperuser: { |
| 60 | disabled: true, |
| 61 | description: 'User is a Superuser', |
| 62 | grant_by_dashboard: false, |
| 63 | }, |
| 64 | isReplicationRole: { |
| 65 | disabled: false, |
| 66 | description: |
| 67 | 'User can initiate streaming replication and put the system in and out of backup mode', |
| 68 | grant_by_dashboard: true, |
| 69 | }, |
| 70 | } as const |