Create custom roles
Custom roles can contain a combination of organization, service, and database permissions. Permissions may be applied to all or a subset of services and databases.1
Access organization settings and select Users and roles
From the services page, select the name of your organization. Select the
Users and roles menu item from the popup menu.2
Select the Roles tab
Select the
Roles tab from the top middle of the screen.3
Select Create new role from the upper right
Select the
Create new role button in the upper right of the screen.4
Name the role
Enter a descriptive role name. This will be the name you will see when assigning roles to users and API keys.
5
Click Allow and select permission scope
Click the
Allow button and select from Organization, Service, and/or Database permissions. For a description of all permissions, see Console roles and permissions.Data Sources tab accessTo access the Data Sources tab, the role currently requires the
Manage and Delete Selected Services permission.6
Review your new role
Review permissions assigned to your new role before finalizing. Click
Create role when done.Manage database roles (beta)
In addition to console permissions, custom roles can include data permissions that control access to the databases of selected services. This lets you manage console and database access in one place instead of maintaining separate roles in each database.This feature is in beta and is available for services running ClickHouse version 26.4 and above.
cloud:. For example, a custom role named readonly appears in the database as cloud:readonly. Members of the custom role receive these database permissions when they connect to the service through SQL console passwordless authentication.
Roles assigned manually in the database using the
sql-console-role:<email> naming convention take precedence over roles assigned through the console.1
Add data permissions to a role
Create a custom role or edit an existing one. In the role dialog, click the
Allow permissions button and select Data.2
Select the service
Select the service the permissions apply to. Add more services to apply permissions across multiple services.
3
Choose the access level
Select
Read-only, Admin, or Custom access. With Custom access, define specific data access permissions using ClickHouse GRANT statements.4
Create the role
Click
Create role. The database roles are created in the selected services.Verify database roles
Roles managed through the console are created in the database with thecloud: prefix and the cloud storage type. To list them, query the system.roles table in the service:
Update custom roles
Custom roles may be updated after they’re created. Users will lose any permissions removed from the role and will gain any permissions added.- Access organization settings and select
Users and roles - Select the
Rolestab - Select the three dots next to the role you would like to update
- Select
Edit - Modify the permissions
- Select
Edit role
Delete custom roles
Custom roles may be deleted at any time.- Access organization settings and select
Users and roles - Select the
Rolestab - Select the three dots next to the role you would like to delete
- Review the users and API keys that will lose access when the role is removed. Adjust assignments as needed.
- Select
Delete roleto complete the process