Zanzana: Use correct namespace when evaluating permission (#96258)

Use correct namespace
This commit is contained in:
Karl Persson 2024-11-12 11:52:29 +01:00 committed by GitHub
parent 7812cb83e9
commit db6422c8a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,8 +8,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/otel"
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/metrics"
@ -133,8 +131,7 @@ func (a *AccessControl) evaluateZanzana(ctx context.Context, user identity.Reque
_, _, parentFolder = accesscontrol.SplitScope(scopes[1])
}
namespace := claims.OrgNamespaceFormatter(user.GetOrgID())
req, ok := zanzana.TranslateToCheckRequest(namespace, action, kind, parentFolder, identifier)
req, ok := zanzana.TranslateToCheckRequest(user.GetNamespace(), action, kind, parentFolder, identifier)
if !ok {
// unsupported translation
return false, errAccessNotImplemented