From fad139866842ecfec79b2a0be1550aae9a20f688 Mon Sep 17 00:00:00 2001 From: ivanszabo Date: Fri, 11 Apr 2025 10:56:44 +0200 Subject: [PATCH] =?UTF-8?q?Csak=20a=20Web=20be=C3=A1ll=C3=ADtott=20l=C3=A9?= =?UTF-8?q?phet=20be?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WorkFlowCheck.BL/Services/UserService.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/WorkFlowCheck.BL/Services/UserService.cs b/src/WorkFlowCheck.BL/Services/UserService.cs index 2503cad..f22f445 100644 --- a/src/WorkFlowCheck.BL/Services/UserService.cs +++ b/src/WorkFlowCheck.BL/Services/UserService.cs @@ -135,7 +135,17 @@ namespace WorkFlowCheck.BL.Services .FirstOrDefaultAsync(); if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password)) { - if (!string.IsNullOrEmpty(user.Email)) + var canUseWebAdmin = false; + foreach (var userRole in user.UserRoles) + { + if (userRole.Role.CanUseWebAdmin) + { + canUseWebAdmin = true; + break; + } + } + + if (!string.IsNullOrEmpty(user.Email) && canUseWebAdmin) { var code = CodeGenerator2F.GenerateSixDigitCode();