Skip to main content

Common RBAC queries

Queries to help grant specific permissions to users.

Introduction​

The following are common queries to help grant specific permissions to users.

How do I grant the same permissions as the current user to another user?​

GRANT CURRENT GRANTS ON *.* TO another_user;

How do I grant a specific permission to a user based on the grants of the current user?​

In the below example, another_user will be able to perform SELECT commands on all of the databases and tables of the current user.

GRANT CURRENT GRANTS(SELECT ON *.*) TO another_user;

How do I grant a specific permission to a user for a specific database based on the grants of the current user?​

In the below example, another_user will be able to perform INSERT commands to all tables in my_database.

GRANT INSERT ON my_database.* TO another_user;

How do I give access to all grants for a specific user based on the default user?​

GRANT default_role TO another_user;
· One min read