Merge pull request #5073 from ioito/automated-cherry-pick-of-#5072-upstream-release-3.1

Automated cherry pick of #5072: fix: 忽略无权限的资源标签
This commit is contained in:
yunion-ci-robot
2020-02-11 17:22:58 +08:00
committed by GitHub
+2 -2
View File
@@ -23,7 +23,6 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/util/stringutils"
"yunion.io/x/sqlchemy"
@@ -205,7 +204,8 @@ func (manager *SMetadataManager) ListItemFilter(ctx context.Context, q *sqlchemy
sq := resourceView.Query(field)
ownerId, queryScope, err := FetchCheckQueryOwnerScope(ctx, userCred, query, man, policy.PolicyActionList, true)
if err != nil {
return nil, httperrors.NewGeneralError(errors.Wrap(err, "FetchCheckQueryOwnerScope"))
log.Warningf("FetchCheckQueryOwnerScope.%s error: %v", man.Keyword(), err)
continue
}
sq = man.FilterByOwner(sq, ownerId, queryScope)
sq = man.FilterBySystemAttributes(sq, userCred, query, queryScope)