From ef2b3cd7fcbbcea5b20526ace6163ceef345f747 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Tue, 12 Apr 2022 12:09:18 +0800 Subject: [PATCH] fix: more detailed privilege hint (#13975) Co-authored-by: Qiu Jian --- pkg/cloudcommon/db/fetch.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cloudcommon/db/fetch.go b/pkg/cloudcommon/db/fetch.go index e5377a4241..77652f8710 100644 --- a/pkg/cloudcommon/db/fetch.go +++ b/pkg/cloudcommon/db/fetch.go @@ -387,8 +387,9 @@ func FetchCheckQueryOwnerScope( requireScope = queryScope } if doCheckRbac && (requireScope.HigherThan(allowScope) || policyTagFilters.Result.IsDeny()) { - return nil, scope, httperrors.NewForbiddenError("not enough privilege to dp %s (require:%s,allow:%s,query:%s)", - action, requireScope, allowScope, queryScope), policyTagFilters + return nil, scope, httperrors.NewForbiddenError("not enough privilege to do %s:%s:%s (require:%s,allow:%s,query:%s)", + consts.GetServiceType(), manager.KeywordPlural(), action, + requireScope, allowScope, queryScope), policyTagFilters } return ownerId, queryScope, nil, policyTagFilters }