Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

/prefix/credential/user-role-mapping/{tenant}/{username}/{rolename}

nil


6、Privilege Grants

/prefix/credential/privilege-grants/{tenant}/{principalType}/{principalName}/{resourceType}/{resourceName}

[{"resource":"SELECT", "grantor":"Alice"}, {"resource":"UPDATE", "grantor":"Bob"}]


Resources & Privileges defined in Milvus

...

Role admin have ALL the privilege. Role public only has READ and LOAD privileges.


APIs


For every API, parameter tenant is mandatory for avoiding loading too much data to memory.

...

Only root user can grant & revoke privileges.


3、List grants for specific a user/role and resource


Code Block
languagecpp
func UserGrantListPrincipalGrantList(principalName string, principalType string, resourceType string, resourceName string) []UserGrantPrincipalGrant


Output structure:

PrincipalTypePrivilege
PrincipalNamePrincipalTypePrivilegeResourceTypeResourceNamePrincipalName
AliceUSERINSERTCollectiontbl_1AliceUserINSERT

Users can only query the grants for himself. And only root user can query grants for a role.

...