Roles.constants.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. // [Joshen] This was originally in the Roles mobx store
  23. // Just keeping it for now in case we need to differ it from ^ BRIVEN_ROLES
  24. export const SYSTEM_ROLES = [
  25. 'postgres',
  26. 'pgbouncer',
  27. 'briven_admin',
  28. 'briven_auth_admin',
  29. 'briven_storage_admin',
  30. 'dashboard_user',
  31. 'authenticator',
  32. 'pg_database_owner',
  33. 'pg_read_all_data',
  34. 'pg_write_all_data',
  35. ] as const
  36. export const ROLE_PERMISSIONS = {
  37. canLogin: {
  38. disabled: false,
  39. description: 'User can login',
  40. grant_by_dashboard: true,
  41. },
  42. canCreateRole: {
  43. disabled: false,
  44. description: 'User can create roles',
  45. grant_by_dashboard: true,
  46. },
  47. canCreateDb: {
  48. disabled: false,
  49. description: 'User can create databases',
  50. grant_by_dashboard: true,
  51. },
  52. canBypassRls: {
  53. disabled: false,
  54. description: 'User bypasses every row level security policy',
  55. grant_by_dashboard: true,
  56. },
  57. isSuperuser: {
  58. disabled: true,
  59. description: 'User is a Superuser',
  60. grant_by_dashboard: false,
  61. },
  62. isReplicationRole: {
  63. disabled: false,
  64. description:
  65. 'User can initiate streaming replication and put the system in and out of backup mode',
  66. grant_by_dashboard: true,
  67. },
  68. } as const