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 result of list collection is empty when login with the user added in the role granted with the built-in privilege group "DatabaseReadOnly"/"DatabaseReadWrite"/"DatabaseAdmin" #38041

Closed
1 task done
binbinlv opened this issue Nov 27, 2024 · 6 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 result of list collection is empty when login with the user added in the role granted with the built-in privilege group "DatabaseReadOnly"/"DatabaseReadWrite"/"DatabaseAdmin"

Expected Behavior

The result of list collection is not empty when login with the user added in the role granted with the built-in privilege group "DatabaseReadOnly"/"DatabaseReadWrite"/"DatabaseAdmin"

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(privilege="DatabaseReadOnly", db_name="default", collection_name="*")
role.list_grants()

connections.disconnect('default')
connections.connect(host="", user="user1", password="Milvus")
utility.list_collections()

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

And the followings in red "N" do not work as expected:

c89993eb-fce5-4c32-b7b3-476e2024911a

@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

same problem with issue: #38041

@binbinlv
Copy link
Contributor Author

binbinlv commented Dec 4, 2024

The "showCollections" privilege is default now, so as designed.

And if not grant the collection operation previleges like (Createcollection, Insert, upsert, ...), list_collections will be empty.

"list_collections" here in privilege scenario means list all the collections that user has operation previleges.

So close this issue.

@binbinlv binbinlv closed this as completed Dec 4, 2024
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