milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
326 stars 105 forks source link

enhance: Add ListGrants and ListGrant RBAC methods #743

Closed punkerpunker closed 3 months ago

punkerpunker commented 4 months ago

Resolves #744

Two methods:

// ListGrant lists a grant info for the role and the specific object
ListGrant(ctx context.Context, role string, object string, objectName string, dbName string) ([]entity.RoleGrants, error)
// ListGrants lists all assigned privileges and objects for the role.
ListGrants(ctx context.Context, role string, dbName string) ([]entity.RoleGrants, error)

And a structure:

type RoleGrants struct {
    Object        string
    ObjectName    string
    RoleName      string
    GrantorName   string
    PrivilegeName string
    DbName        string
}

PyMilvus's implementation (and signatures, names) of such methods was taken as an inspiration here.

Thanks!

punkerpunker commented 3 months ago

Hi @congqixia, can we please get this one merged? Thanks! That one follows the #697

sre-ci-robot commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia, punkerpunker

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/milvus-io/milvus-sdk-go/blob/master/OWNERS)~~ [congqixia] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment