normalizar permisos y controladores

This commit is contained in:
2026-01-01 20:13:01 -06:00
parent cfb06aea25
commit 278c230f27

View File

@@ -49,7 +49,7 @@ public class DynamicAuthorizationFilter : IAsyncAuthorizationFilter
// The permission code is expected to match the Controller Name (e.g., "Usuario", "Rol", "Colaborador") // The permission code is expected to match the Controller Name (e.g., "Usuario", "Rol", "Colaborador")
// In AccountController, we added claims of type "Permission" with the permission code // In AccountController, we added claims of type "Permission" with the permission code
var hasPermission = user.HasClaim(c => c.Type == "Permission" && var hasPermission = user.HasClaim(c => c.Type == "Permission" &&
c.Value.Equals(controllerName, StringComparison.OrdinalIgnoreCase)); c.Value.ToUpperInvariant().Equals(controllerName.ToUpperInvariant(), StringComparison.OrdinalIgnoreCase));
if (!hasPermission) if (!hasPermission)
{ {