Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [privilege_group] The interface "grant_v2" does not support empty collectionName while the error says it does #38042

Open
1 task done
binbinlv opened this issue Nov 27, 2024 · 4 comments
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Nov 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-latest
- 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 interface "grant_v2" does not support empty collectionName while the error says it does

role.grant_v2("DatabaseReadOnly", "default", "binbin_new_1")
(code=65535, message=collectionName should be empty or * for the database level privilege: DatabaseReadOnly
role.grant_v2("DatabaseReadOnly", "default")
TypeError: grant_v2() missing 1 required positional argument: 'collection_name'
role.grant_v2("DatabaseReadOnly", "default", "")
code=1, message=`collection_name` value  is illegal

Expected Behavior

The interface "grant_v2" supports empty collectionName

Steps To Reproduce

from pymilvus import connections
from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility
from pymilvus import MilvusClient
from pymilvus import Role

connections.connect(host="***", user="root", password="Milvus")
client = MilvusClient(uri="http://***:19530", user="root", password="Milvus")
client.create_collection("binbin_new", dimension=128)
role = Role("binbin")
role.create()
utility.list_roles(True)
utility.create_user(user="user1", password="Milvus")
role.add_user("user1")
utility.list_roles(True)
role.list_grants()
role.grant_v2("DatabaseReadOnly", "default", "binbin_new_1")
role.grant_v2("DatabaseReadOnly", "default")
role.grant_v2("DatabaseReadOnly", "default", "")


### Milvus Log

_No response_

### Anything else?

_No response_
@binbinlv binbinlv added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 27, 2024
@binbinlv binbinlv added this to the 2.5.0 milestone Nov 27, 2024
@binbinlv binbinlv added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 27, 2024
@binbinlv
Copy link
Contributor Author

/assign @shaoting-huang

@sre-ci-robot
Copy link
Contributor

@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:

/assign @shaoting-huang

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@shaoting-huang
Copy link
Contributor

/assign

@shaoting-huang
Copy link
Contributor

after fix:

>>> role.grant_v2("ReadOnly", "default", "")
>>> role.list_grants()
GrantInfo groups:
- GrantItem: <object:Global>, <object_name:*>, <db_name:default>, <role_name:binbin>, <grantor_name:root>, <privilege:DatabaseReadOnly>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants