roles and login in the web UI
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace LaaProduction
|
||||
{
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
|
||||
using System.Web.Mvc;
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
using LaaProductionHttp.Interfaces;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.Areas.Personalization.Models.Employees;
|
||||
|
||||
using System;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.Areas.Personalization.Models.Software;
|
||||
using LaaProduction.Services.Interfaces;
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
namespace LaaProduction.Web.Controllers.API.Personalization
|
||||
{
|
||||
using LaaProduction.Personalization.Interfaces;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
namespace LaaProduction.Web.Controllers.API.Personalization
|
||||
{
|
||||
using LaaProduction.Personalization.Interfaces;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
|
||||
using System.Web.Http;
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
namespace LaaProduction.Web.Controllers.API.Personalization
|
||||
{
|
||||
using LaaProduction.Personalization.Interfaces;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
|
||||
using System.Web.Http;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace LaaProduction.Web.Controllers.API.Search
|
||||
{
|
||||
using LaaProduction.Search;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Services.Interfaces;
|
||||
|
||||
using System.Web.Mvc;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Services.Interfaces;
|
||||
using LaaProduction.Services.Models;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Services.Interfaces;
|
||||
using LaaProduction.Services.Models;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Services.Interfaces;
|
||||
using LaaProduction.Services.Models.Reports;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
using LaaProductionHttp.Interfaces;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Services.Interfaces;
|
||||
using LaaProduction.Services.Models.Search;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowedRoles(UsersRoles.WEB_Admin)]
|
||||
[AllowedRoles(UsersRoles.WEB_API_Explorer)]
|
||||
public async Task<ActionResult> Wildcard()
|
||||
{
|
||||
var fieldsResult = await this.httpClient
|
||||
@@ -75,7 +75,7 @@
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[AllowedRoles(UsersRoles.WEB_Admin)]
|
||||
[AllowedRoles(UsersRoles.WEB_API_Explorer)]
|
||||
public async Task<ActionResult> Wildcard(SearchWildcardModel model)
|
||||
{
|
||||
var fields = string.Empty;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using LaaProduction.Personalization;
|
||||
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Web.App_Infrastructure;
|
||||
using LaaProduction.Services.Interfaces;
|
||||
using LaaProduction.Services.Models;
|
||||
|
||||
|
||||
@@ -54,4 +54,15 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (this.TempData.ContainsKey("Unauthorized"))
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<hr />
|
||||
<h4 class="text-danger">@this.TempData["Unauthorized"]</h4>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
Reference in New Issue
Block a user