roles and login in the web UI

This commit is contained in:
Stoyan Zlatev
2023-06-19 16:12:29 +02:00
parent cb2501dbd4
commit 8390605055
15 changed files with 30 additions and 16 deletions
@@ -18,8 +18,11 @@
{
if (filterContext.HttpContext.User is ClaimsPrincipal claimsPrincipal)
{
filterContext.Controller.TempData["Unauthorized"] = "Dir fehlen berechtigungen.";
var controller = filterContext.Controller;
controller.TempData["Unauthorized"] = $"Access denied: {filterContext.HttpContext.Request.Url}";
filterContext.Result = new RedirectResult("~/");
filterContext.Result.ExecuteResult(controller.ControllerContext);
}
else
{