File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
docs/en/sql-reference/10-sql-commands/00-ddl/02-user Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ SHOW GRANTS FOR ROLE <role_name> [ LIKE '<pattern>' | WHERE <expr> | LIMIT <limi
25
25
26
26
-- List privileges granted on an object
27
27
SHOW GRANTS ON { STAGE | TABLE | DATABASE | UDF } < object_name> [ LIKE ' <pattern>' | WHERE < expr> | LIMIT < limit > ]
28
+
29
+ -- Lists all users and roles that have been directly granted role_name.
30
+ SHOW GRANTS OF ROLE < role_name>
31
+
28
32
```
29
33
30
34
## Examples
@@ -71,4 +75,18 @@ SHOW GRANTS ON DATABASE my_db;
71
75
│ privileges │ object_name │ object_id │ grant_to │ name │ grants ├────────────┼─────────────┼──────────────────┼──────────┼─────────┼──────────────────┤
72
76
│ OWNERSHIP │ my_db │ 16 │ ROLE │ analyst │ │
73
77
└─────────────────────────────────────────────────────────────────────────────────────┘
78
+
79
+ -- Lists all users and roles that have been directly granted role_name.
80
+ -- This command displays only the direct grantees of role_name.
81
+ -- This means it lists users and roles that have explicitly received the role through a GRANT ROLE role_name TO <user_or_role> statement.
82
+ -- It does not show users or roles that acquire role_name indirectly via role hierarchies or inheritance.
83
+ SHOW GRANTS OF ROLE analyst
84
+
85
+ ╭─────────────────────────────────────╮
86
+ │ role │ granted_to │ grantee_name │
87
+ │ String │ String │ String │
88
+ ├─────────┼────────────┼──────────────┤
89
+ │ analyst │ USER │ user1 │
90
+ ╰─────────────────────────────────────╯
91
+
74
92
```
You can’t perform that action at this time.
0 commit comments