From a579cf37ce7af058ab0817fe52adb208696d2758 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 9 Apr 2025 17:44:59 +0300 Subject: [PATCH] fix: allow user if users label is empty --- internal/auth/auth.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 6c1e629..d4a73ac 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -295,12 +295,11 @@ func (auth *Auth) ResourceAllowed(c *gin.Context, context types.UserContext) (bo // Check if user is allowed if len(labels.Users) != 0 { log.Debug().Msg("Checking users") - if len(labels.Users) == 0 { - return true, nil - } if slices.Contains(labels.Users, context.Username) { return true, nil } + } else { + return true, nil } // Not allowed