Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1019 Bytes

common-rbac-queries.md

File metadata and controls

35 lines (24 loc) · 1019 Bytes
title description date
Common RBAC queries
Queries to help grant specific permissions to users.
2023-09-28

Common role-based access control (RBAC) queries

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;