UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Overview
  • User Management
  • Role Management
  • Grant & Revoke Permissions
  • Best Practices
  1. Docs
  2. /
  3. Access Control

Grant & Revoke Permissions

Overview

Ultipa GQLDB provides 40 fine-grained permission operations organized by category. Each operation can be applied at one or more scopes: the database, a specific graph, a node label, an edge label, or a stored procedure within a graph.

Use GRANT to add permissions and REVOKE to remove them. Permissions are granted to roles, and roles are then assigned to users.

Scopes

Scopes form a hierarchy from broad to specific:

Scope syntaxLevelDescription
ON DATABASE1All graphs and database-wide operations
ON GRAPH <name>2Specific graph
ON GRAPH *2All graphs
ON GRAPH <name> NODE <label>3Specific node label within a graph
ON GRAPH <name> EDGE <label>3Specific edge label within a graph
ON GRAPH <name> PROCEDURE <name>3Specific stored procedure within a graph
ON GRAPH <name> PROCEDURE *3All stored procedures within a graph

Permission Operations

List all available operations and their valid scopes:

GQL
SHOW PERMISSIONS

Returns columns operation, description, and valid_scopes.

Data Operations

OperationDescriptionValid Scopes
READQuery and read dataDATABASE, GRAPH, NODE, EDGE
INSERTInsert new nodes and edgesDATABASE, GRAPH, NODE, EDGE
UPDATEUpdate existing dataDATABASE, GRAPH, NODE, EDGE
DELETEDelete nodes and edgesDATABASE, GRAPH, NODE, EDGE
MERGEMerge (upsert) operationsDATABASE, GRAPH
ALL_DATAAll data ops (READ + INSERT + UPDATE + DELETE + MERGE)DATABASE, GRAPH

Schema (DDL) Operations

OperationDescriptionValid Scopes
CREATE_GRAPHCreate graphsDATABASE, GRAPH
DROP_GRAPHDrop graphsDATABASE, GRAPH
ALTER_GRAPHAlter graphs (rename, set mode, add/drop types)GRAPH
TRUNCATE_GRAPHTruncate graph labelsGRAPH
CREATE_INDEXCreate indexes (regular, vector, fulltext)GRAPH
DROP_INDEXDrop indexesGRAPH
CREATE_CONSTRAINTCreate constraintsGRAPH
DROP_CONSTRAINTDrop constraintsGRAPH
CREATE_PROJECTIONCreate projectionsGRAPH
DROP_PROJECTIONDrop projectionsGRAPH
CREATE_TRIGGERCreate triggersGRAPH
DROP_TRIGGERDrop triggersGRAPH
CREATE_GRAPH_TYPECreate graph typesGRAPH
DROP_GRAPH_TYPEDrop graph typesGRAPH
SHOW_SCHEMAView schema metadataDATABASE, GRAPH
ALL_SCHEMAAll DDL schema operationsDATABASE, GRAPH

Backup & Restore

OperationDescriptionValid Scopes
BACKUPBackup graphs or databaseDATABASE
RESTORERestore graphs or databaseDATABASE

Stored Procedures & Algorithms

OperationDescriptionValid Scopes
CREATE_PROCEDURECreate stored proceduresDATABASE, GRAPH, PROCEDURE
DROP_PROCEDUREDrop stored proceduresDATABASE, GRAPH, PROCEDURE
EXECUTE_PROCEDUREExecute stored procedures (CALL)DATABASE, GRAPH, PROCEDURE
SHOW_PROCEDUREView procedure definitionsDATABASE, GRAPH, PROCEDURE
EXECUTE_ALGORITHMExecute built-in algorithms (CALL algo.*)DATABASE

Task & Query Management

OperationDescriptionValid Scopes
MANAGE_TASKTOP, KILL, SHOW TASK, DELETE TASKDATABASE
MANAGE_QUERYTOP QUERIES, KILL QUERY, SHOW QUERIESDATABASE

Security Management

OperationDescriptionValid Scopes
USER_MANAGEMENTCREATE / ALTER / DROP / SHOW USERDATABASE
ROLE_MANAGEMENTCREATE / ALTER / DROP / SHOW ROLEDATABASE
GRANT_MANAGEMENTGRANT / REVOKE / SHOW GRANTSDATABASE

Infrastructure

OperationDescriptionValid Scopes
MANAGE_ONTOLOGYOntology management (PREFIX, CLASS, etc.)GRAPH
MANAGE_SERVICEFederation service managementGRAPH
MANAGE_COMPUTECompute engine managementGRAPH
ANALYZEStatistics and maintenance (ANALYZE, COMPACT)DATABASE, GRAPH

Wildcards

OperationDescription
* or ALLMatches all operations
ADMINLegacy superuser (matches all operations)

Granting Roles to Users

GQL
GRANT ROLE data_reader TO USER alice

Revoking Roles from Users

GQL
REVOKE ROLE data_reader FROM USER alice

Granting Permissions to Roles

Syntax
<grant statement> ::=
  "GRANT" <operation> [ { "," <operation> } ...] "ON" <scope> "TO" [ "ROLE" ] <role name>

Grant read access on a specific graph:

GQL
GRANT READ ON GRAPH social_network TO ROLE data_reader

Grant multiple operations in one statement:

GQL
GRANT INSERT, UPDATE, DELETE ON GRAPH social_network TO ROLE data_writer

Wildcard operation (all permissions):

GQL
GRANT * ON GRAPH * TO ROLE custom_admin

Database-wide grants:

GQL
GRANT READ ON DATABASE TO ROLE global_reader
GRANT BACKUP ON DATABASE TO ROLE backup_operator
GRANT USER_MANAGEMENT ON DATABASE TO ROLE security_team

Grant on all graphs:

GQL
GRANT READ ON GRAPH * TO ROLE global_reader

Label-level access:

GQL
GRANT READ ON GRAPH social_network NODE Person TO ROLE analytics
GRANT INSERT ON GRAPH social_network EDGE KNOWS TO ROLE analytics

Procedure-level access:

GQL
GRANT EXECUTE_PROCEDURE ON GRAPH sales PROCEDURE calc_revenue TO ROLE analyst
GRANT EXECUTE_PROCEDURE ON GRAPH sales PROCEDURE * TO ROLE proc_runner

Revoking Permissions from Roles

Syntax
<revoke statement> ::=
  "REVOKE" <operation> [ { "," <operation> } ...] "ON" <scope> "FROM" [ "ROLE" ] <role name>
GQL
REVOKE INSERT ON GRAPH social_network FROM ROLE data_writer
REVOKE READ ON GRAPH social_network NODE Person FROM ROLE analytics

Showing Grants

Show all grants in the database:

GQL
SHOW GRANTS

Show grants for a specific user (includes grants inherited from all assigned roles):

GQL
SHOW GRANTS FOR USER alice

Show grants for a specific role:

GQL
SHOW GRANTS FOR ROLE data_reader

Result columns:

ColumnDescription
operationThe permission operation, e.g., READ, INSERT, CREATE_INDEX
scopeScope level: DATABASE, GRAPH, NODE, EDGE, or PROCEDURE
resourceThe specific resource the grant applies to (graph name, label, procedure name, or *)
effectALLOW for grants issued through GQL

Examples

Complete RBAC Setup

GQL
// Create roles
CREATE ROLE app_readonly
CREATE ROLE app_readwrite
CREATE ROLE app_admin

// Create users
CREATE USER frontend_service PASSWORD 'frontend_pwd_12345'
CREATE USER backend_service PASSWORD 'backend_pwd_12345'
CREATE USER admin_user PASSWORD 'admin_pwd_12345'

// Grant permissions to roles
GRANT READ ON GRAPH production TO ROLE app_readonly
GRANT READ, INSERT, UPDATE, DELETE ON GRAPH production TO ROLE app_readwrite
GRANT * ON GRAPH * TO ROLE app_admin

// Assign roles to users
GRANT ROLE app_readonly TO USER frontend_service
GRANT ROLE app_readwrite TO USER backend_service
GRANT ROLE app_admin TO USER admin_user

Label-Level Access Control

GQL
// Analytics team: read Person nodes and KNOWS edges only
CREATE ROLE analytics
GRANT READ ON GRAPH social_network NODE Person TO ROLE analytics
GRANT READ ON GRAPH social_network EDGE KNOWS TO ROLE analytics

Procedure-Level Access Control

GQL
// Allow analyst to run a specific stored procedure
CREATE ROLE revenue_analyst
GRANT EXECUTE_PROCEDURE ON GRAPH sales PROCEDURE calc_revenue TO ROLE revenue_analyst