Versions Compared

Key

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

...


Users/Roles can be granted the following privileges:

PrivilegesResources
ALLCollection
CREATECollection
DROPCollection
ALTERCollection
SELECT
READCollection
INSERT
LOADCollection
DELETE
RELEASECollection
UPDATE
COMPACTCollection
GRANT
INSERTCollection
REVOKE
DELETECollection


Index-related operations are included in ALTER privilege, like building, dropping index.


Default Roles


TODO


APIs


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

...

Code Block
languagecpp
func GrantPrivilege(privilege string, resourceType string, resourceName string, principalName string, principalType string) bool

func RevokePrivilege(privilege string, resourceType string, resourceName string, principalName string, principalType string) bool


The user granting privileges must also have the privilege being granted on the target collection. For example, a user granting SELECT privilege on a collection to another user must have the GRANT and SELECT privileges on that table. There is no limitation for the root user.Only root user can grant & revoke privileges.


3、List grants for specific user/role and resource

...

Code Block
languagecpp
func AddUserToRole(userName, roleName string) bool

func RemoveUserFromRole(userName, roleName string) bool


Only root user can manipulate role membership.

...

Output:

RoleName
admin
role_a


Only root user can use the api.


8、List role memberships


Code Block
languagecpp
func RoleMembershipList(roleName string) []RoleMembership

...

Only root user can use the api.


10、List roles of a user (useless???)


Code Block
languagecpp
func rolesOfUser(username string) []string

...

  1. Presetting users, resource types, privileges are stored in local files. When milvus starts, it will load these files and insert records into database.
  2. Presetting users, resource types and privileges can be added into files and taking effect after restarting milvus service.
  3. The root user is the only user that has privileges for creatingto create/droppingdrop/grantinggrant/revoking revoke users and privileges.
  4. In MEP-27, basic auth is taking effect if there are any existing users. Since root user is created by default once Milvus service starts, it needs to will introduce a toggle to know indicate whether the basic auth authentication is turned on.
  5. Using Casbin for role-based privileges check.

...