milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
30.87k stars 2.94k forks source link

[Bug]: [privilege_group] The object name is * rather than the collection names returned by "list_grants()" when grant the role with the built-in privilege group to collection level #37903

Open binbinlv opened 1 day ago

binbinlv commented 1 day ago

Is there an existing issue for this?

Environment

- Milvus version: master-20241120-c73ca14a-amd64
- Deployment mode(standalone or cluster):both
- MQ type(rocksmq, pulsar or kafka):    all
- SDK version(e.g. pymilvus v2.0.0rc2): 2.5.0rc126
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

The object name is * rather than the collection names returned by "list_grants()" when grant the role with the built-in privilege group to collection level

role.grant(object="Global", object_name="binbin", privilege="CollectionReadOnly")

>>> role.list_grants()
GrantInfo groups:
- GrantItem: <object:Global>, <object_name:*>, <db_name:default>, <role_name:binbin_new>, <grantor_name:root>, <privilege:CollectionReadOnly>

Expected Behavior

The object name is the collection names rather than "*" returned by "list_grants()" when grant the role with the built-in privilege group to collection level

Steps To Reproduce

from pymilvus import Role
from pymilvus import connections
connections.connect()
role = Role("newRole")
role.create()
role.grant(object="Global", object_name="binbin", privilege="CollectionReadOnly")
role.list_grants()

Milvus Log

No response

Anything else?

No response

binbinlv commented 1 day ago

/assign @shaoting-huang

sre-ci-robot commented 1 day ago

@binbinlv: GitHub didn't allow me to assign the following users: shaoting-huang.

Note that only milvus-io members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide

In response to [this](https://github.com/milvus-io/milvus/issues/37903#issuecomment-2490660667): >/assign @shaoting-huang Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.