UltipaDocs
Try Playground
  • Overview
  • User Management
  • Role Management
  • Grant & Revoke
  • Permission Levels
  • Best Practices
  1. Docs
  2. /
  3. Access Control

Role Management

Overview

Create roles to group permissions. Roles make it easy to manage access for groups of users.

Built-in System Roles:

RoleDescription
adminFull database access
readerRead-only access
writerRead and write access
schema_adminSchema management

Role Statements

StatementDescription
CREATE ROLECreate a new role
ALTER ROLE RENAME TORename a role
ALTER ROLE SET DESCRIPTIONUpdate role description
DROP ROLEDelete a role
SHOW ROLESList all roles
SHOW ROLEShow specific role details

Creating Roles

GQL
CREATE ROLE 'data_reader'

With description:

GQL
CREATE ROLE 'schema_manager' DESCRIPTION 'Can modify database schema'

Altering Roles

Rename a role:

GQL
ALTER ROLE 'data_reader' RENAME TO 'analytics_reader'

Update description:

GQL
ALTER ROLE 'data_reader' SET DESCRIPTION 'Read-only access for analytics'

Dropping Roles

GQL
DROP ROLE 'data_reader'

Use IF EXISTS to avoid errors:

GQL
DROP ROLE IF EXISTS 'data_reader'

Showing Roles

List all roles:

GQL
SHOW ROLES

Result:

namedescription
adminFull database access
readerRead-only access
writerRead and write access
schema_adminSchema management

Show specific role:

GQL
SHOW ROLE admin