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 privilege granted by interface "grant" could not be revoked by interface "revoke_v2" #38008

Open
1 task done
binbinlv opened this issue Nov 25, 2024 · 2 comments
Assignees
Labels
kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Nov 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-20241125-0b9edb62-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 privilege granted by interface "grant" could not be revoked by interface "revoke_v2"

>>> role.grant(object="Collection", object_name="binbin_new", privilege="Insert")
>>> role.list_grants()
GrantInfo groups:
- GrantItem: <object:Collection>, <object_name:binbin_new>, <db_name:default>, <role_name:binbin>, <grantor_name:root>, <privilege:Insert>
>>> role.revoke_v2(privilege="Insert", db_name="default", collection_name="binbin_new")
>>> role.list_grants()
GrantInfo groups:
- GrantItem: <object:Collection>, <object_name:binbin_new>, <db_name:default>, <role_name:binbin>, <grantor_name:root>, <privilege:Insert>
>>>

using revoke v1 , the privilege could be revoked successfully

>>> role.revoke_v2(privilege="Insert", db_name="default", collection_name="binbin_new")
>>> role.list_grants()
GrantInfo groups:
- GrantItem: <object:Collection>, <object_name:binbin_new>, <db_name:default>, <role_name:binbin>, <grantor_name:root>, <privilege:Insert>
>>>
>>> role.revoke(object="Collection", object_name="binbin_new", privilege="Insert")
>>> role.list_grants()
GrantInfo groups:
>>>

Expected Behavior

No response

Steps To Reproduce

from pymilvus import connections
from pymilvus import MilvusClient
from pymilvus import Role
from pymilvus import utility

connections.connect(host="", user="root", password="Milvus")
client = MilvusClient(uri="", user="root", password="Milvus")
client.create_collection("binbin_new", dimension=128)
utility.list_roles(True)
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(object="Collection", object_name="binbin_new", privilege="Insert")
role.list_grants()
role.revoke_v2(privilege="Insert", db_name="default", collection_name="binbin_new")
role.list_grants()

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 25, 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.

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

3 participants