mirror of https://github.com/milvus-io/milvus.git
fix: show empty collection when has granted the all privilege (#33445)
- issue: #33382 Signed-off-by: SimFG <bang.fu@zilliz.com>pull/33458/head
parent
54797b4286
commit
8f46a20957
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue