mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 09:38:39 +08:00
fix: show empty collection when has granted the all privilege (#33445)
- issue: #33382 Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
parent
54797b4286
commit
8f46a20957
@ -89,7 +89,7 @@ func (t *showCollectionTask) Execute(ctx context.Context) error {
|
|||||||
for _, entity := range entities {
|
for _, entity := range entities {
|
||||||
objectType := entity.GetObject().GetName()
|
objectType := entity.GetObject().GetName()
|
||||||
if objectType == commonpb.ObjectType_Global.String() &&
|
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)
|
privilegeColls.Insert(util.AnyWord)
|
||||||
return privilegeColls, nil
|
return privilegeColls, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -298,7 +298,9 @@ func TestShowCollectionsAuth(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Object: &milvuspb.ObjectEntity{Name: commonpb.ObjectType_Global.String()},
|
Object: &milvuspb.ObjectEntity{Name: commonpb.ObjectType_Global.String()},
|
||||||
Grantor: &milvuspb.GrantorEntity{
|
Grantor: &milvuspb.GrantorEntity{
|
||||||
Privilege: &milvuspb.PrivilegeEntity{Name: commonpb.ObjectPrivilege_PrivilegeAll.String()},
|
Privilege: &milvuspb.PrivilegeEntity{
|
||||||
|
Name: util.PrivilegeNameForAPI(commonpb.ObjectPrivilege_PrivilegeAll.String()),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, nil).Once()
|
}, nil).Once()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user