...
Only root user can grant & revoke privileges.
3、List grants for specific a user/role and resource
Code Block | ||
---|---|---|
| ||
func UserGrantList(principalName string, principalType string, resourceType string, resourceName string) []UserGrant |
Output structure:
Username | Privilege | ResourceType | ResourceNamePrincipalName | ||||
---|---|---|---|---|---|---|---|
Alice | PrincipalTypeINSERT | Privilege | Collection | tbl_1 | Alice | User | INSERT |
Users can only query the grants for himself. And only root user can query grants for a role.
...