This statement is used to show the permissions granted to a user or role in the resource.
1 | SHOW GRANT ((ROLE [db_name].role_name) | (USER user_name)) ON resource; |
ROLE: The subsequent role_name must be a role.
USER: The subsequent user_name must be a user.
The resource can be a queue, database, table, view, or column. The formats are as follows:
Run the following statement to show permissions of user_name1 in the db1 database:
1 | SHOW GRANT USER user_name1 ON databases.db1; |
Run the following statement to show permissions of role_name on table tb1 in the db1 database:
1 | SHOW GRANT ROLE role_name ON databases.db1.tables.tb1; |