diff --git a/pkg/cloudcommon/db/metadata.go b/pkg/cloudcommon/db/metadata.go index 3bb3205a75..757b26c3d8 100644 --- a/pkg/cloudcommon/db/metadata.go +++ b/pkg/cloudcommon/db/metadata.go @@ -163,7 +163,7 @@ func (manager *SMetadataManager) ListItemFilter(ctx context.Context, q *sqlchemy prefix := sqlchemy.NewStringField(fmt.Sprintf("%s::", man.Keyword())) field := sqlchemy.CONCAT(man.Keyword(), prefix, resourceView.Field("id")) sq := resourceView.Query(field) - if !admin || !IsAllowList(rbacutils.ScopeSystem, userCred, man) { + if !admin && !IsAllowList(rbacutils.ScopeSystem, userCred, man) { sq = man.FilterByOwner(sq, userCred, man.ResourceScope()) } conditions = append(conditions, sqlchemy.In(q.Field("id"), sq))