From 26e147d01f0ade37701451fdc43ed40b995fc52c Mon Sep 17 00:00:00 2001 From: Gabriel MABILLE Date: Tue, 7 Oct 2025 10:12:14 +0200 Subject: [PATCH] AuthZ: Fix cacheHit computation (#112088) * AuthZ: Fix cacheHit computation * Remove the ok bool --- pkg/services/authz/rbac/service.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/services/authz/rbac/service.go b/pkg/services/authz/rbac/service.go index 105f7db7157..9af70a26277 100644 --- a/pkg/services/authz/rbac/service.go +++ b/pkg/services/authz/rbac/service.go @@ -760,12 +760,10 @@ func (s *Service) listPermission(ctx context.Context, scopeMap map[string]bool, cacheHit := false if t.HasFolderSupport() { var err error - ok = false if !req.Options.SkipCache { - tree, ok = s.getCachedFolderTree(ctx, req.Namespace) - cacheHit = true + tree, cacheHit = s.getCachedFolderTree(ctx, req.Namespace) } - if !ok { + if !cacheHit { tree, err = s.buildFolderTree(ctx, req.Namespace) if err != nil { ctxLogger.Error("could not build folder and dashboard tree", "error", err)