From 835a311275bd349db9081f9736dcf95aefc3e6cf Mon Sep 17 00:00:00 2001 From: rainzm Date: Thu, 6 May 2021 16:38:24 +0800 Subject: [PATCH] fix(region): allow domain admin to obtain ssh private keys --- pkg/compute/sshkeys/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compute/sshkeys/handler.go b/pkg/compute/sshkeys/handler.go index 864551ca99..6b1f806571 100644 --- a/pkg/compute/sshkeys/handler.go +++ b/pkg/compute/sshkeys/handler.go @@ -41,7 +41,7 @@ func AddSshKeysHandler(prefix string, app *appsrv.Application) { func adminSshKeysHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) { publicOnly := false userCred := auth.FetchUserCredential(ctx, policy.FilterPolicyCredential) - if !userCred.IsAllow(rbacutils.ScopeSystem, consts.GetServiceType(), "sshkeypairs", policy.PolicyActionGet) { + if !userCred.IsAllow(rbacutils.ScopeDomain, consts.GetServiceType(), "sshkeypairs", policy.PolicyActionGet) { publicOnly = true } params := appctx.AppContextParams(ctx)