Skip to content

Commit

Permalink
fix: show empty collection when has granted the all privilege (#33445)
Browse files Browse the repository at this point in the history
- issue: #33382

Signed-off-by: SimFG <bang.fu@zilliz.com>
  • Loading branch information
SimFG committed May 29, 2024
1 parent 54797b4 commit 8f46a20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/rootcoord/show_collection_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (t *showCollectionTask) Execute(ctx context.Context) error {
for _, entity := range entities {
objectType := entity.GetObject().GetName()
if objectType == commonpb.ObjectType_Global.String() &&
entity.GetGrantor().GetPrivilege().GetName() == commonpb.ObjectPrivilege_PrivilegeAll.String() {
entity.GetGrantor().GetPrivilege().GetName() == util.PrivilegeNameForAPI(commonpb.ObjectPrivilege_PrivilegeAll.String()) {
privilegeColls.Insert(util.AnyWord)
return privilegeColls, nil
}
Expand Down
4 changes: 3 additions & 1 deletion internal/rootcoord/show_collection_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ func TestShowCollectionsAuth(t *testing.T) {
{
Object: &milvuspb.ObjectEntity{Name: commonpb.ObjectType_Global.String()},
Grantor: &milvuspb.GrantorEntity{
Privilege: &milvuspb.PrivilegeEntity{Name: commonpb.ObjectPrivilege_PrivilegeAll.String()},
Privilege: &milvuspb.PrivilegeEntity{
Name: util.PrivilegeNameForAPI(commonpb.ObjectPrivilege_PrivilegeAll.String()),
},
},
},
}, nil).Once()
Expand Down

0 comments on commit 8f46a20

Please sign in to comment.