Files
supabase/apps/studio/components/interfaces/Database/Roles/Roles.constants.ts
Etienne Stalmans f8afb1ee05 chore: mark new temporary support role (#53211)
## Problem

New temporary role that may be added during a support ticket. This shows
up as a normal role, rather than reserved

## Solution

New temporary read-only support role should be marked as supabase
managed.

<img width="1170" height="1057" alt="Image"
src="https://github.com/user-attachments/assets/8e42ac26-e88f-4772-a1b4-d3efc2e5a850"
/>

## Review instructions

Provide a clear numbered procedure that the PR reviewer can walk
through.

1. Create a support user on a staging project (admin-studio)
2. Check the role appears as a Supabase service role in
/dashboard/project/_/database/roles

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-10 16:16:04 +01:00

75 lines
1.8 KiB
TypeScript

export const SUPABASE_ROLES = [
'anon',
'service_role',
'authenticated',
'authenticator',
'dashboard_user',
'supabase_admin',
'supabase_privileged_role',
'supabase_auth_admin',
'supabase_functions_admin',
'supabase_read_only_user',
'supabase_realtime_admin',
'supabase_replication_admin',
'supabase_storage_admin',
'pgbouncer',
'pgsodium_keyholder',
'pgsodium_keyiduser',
'pgsodium_keymaker',
'pgtle_admin',
'cli_login_postgres',
'supabase_etl_admin',
] as const
// Roles managed by Supabase whose names carry a variable suffix, e.g. support_ro_<id>
export const SUPABASE_ROLE_PREFIXES = ['support_ro_'] as const
// [Joshen] This was originally in the Roles mobx store
// Just keeping it for now in case we need to differ it from ^ SUPABASE_ROLES
export const SYSTEM_ROLES = [
'postgres',
'pgbouncer',
'supabase_admin',
'supabase_auth_admin',
'supabase_storage_admin',
'dashboard_user',
'authenticator',
'pg_database_owner',
'pg_read_all_data',
'pg_write_all_data',
] as const
export const ROLE_PERMISSIONS = {
canLogin: {
disabled: false,
description: 'User can login',
grant_by_dashboard: true,
},
canCreateRole: {
disabled: false,
description: 'User can create roles',
grant_by_dashboard: true,
},
canCreateDb: {
disabled: false,
description: 'User can create databases',
grant_by_dashboard: true,
},
canBypassRls: {
disabled: false,
description: 'User bypasses every row level security policy',
grant_by_dashboard: true,
},
isSuperuser: {
disabled: true,
description: 'User is a Superuser',
grant_by_dashboard: false,
},
isReplicationRole: {
disabled: false,
description:
'User can initiate streaming replication and put the system in and out of backup mode',
grant_by_dashboard: true,
},
} as const