PR 2: normalize DiagnosticsController auth; add Maintenance back-links
- DiagnosticsController: replaced raw [Authorize(Roles = "SuperAdmin,Administrator")] with [Authorize(Policy = SuperAdminOnly)] to match every other platform-admin controller; added PowderCoating.Shared.Constants using directive - DataPurge, DataExport, StorageMigration, SeedData: added "← Maintenance" breadcrumb link at the top of each page so operators know they are in the guarded maintenance area and can navigate back to the hub Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using PowderCoating.Shared.Constants;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
|
|
||||||
namespace PowderCoating.Web.Controllers;
|
namespace PowderCoating.Web.Controllers;
|
||||||
|
|
||||||
[Authorize(Roles = "SuperAdmin,Administrator")]
|
[Authorize(Policy = AppConstants.Policies.SuperAdminOnly)]
|
||||||
public class DiagnosticsController : Controller
|
public class DiagnosticsController : Controller
|
||||||
{
|
{
|
||||||
private readonly ILogger<DiagnosticsController> _logger;
|
private readonly ILogger<DiagnosticsController> _logger;
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="container-fluid py-3">
|
<div class="container-fluid py-3">
|
||||||
|
<div class="mb-2">
|
||||||
|
<a asp-controller="PlatformAdmin" asp-action="Maintenance" class="text-muted small text-decoration-none">
|
||||||
|
<i class="bi bi-arrow-left me-1"></i>Maintenance
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div class="d-flex align-items-center justify-content-between mb-3">
|
<div class="d-flex align-items-center justify-content-between mb-3">
|
||||||
<div>
|
<div>
|
||||||
<h4 class="mb-0"><i class="bi bi-file-earmark-arrow-down me-2 text-primary"></i>Data Export</h4>
|
<h4 class="mb-0"><i class="bi bi-file-earmark-arrow-down me-2 text-primary"></i>Data Export</h4>
|
||||||
|
|||||||
@@ -34,6 +34,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="container-fluid py-3">
|
<div class="container-fluid py-3">
|
||||||
|
<div class="mb-2">
|
||||||
|
<a asp-controller="PlatformAdmin" asp-action="Maintenance" class="text-muted small text-decoration-none">
|
||||||
|
<i class="bi bi-arrow-left me-1"></i>Maintenance
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div class="d-flex align-items-center justify-content-between mb-3">
|
<div class="d-flex align-items-center justify-content-between mb-3">
|
||||||
<div>
|
<div>
|
||||||
<h4 class="mb-0"><i class="bi bi-trash3 me-2 text-danger"></i>Data Purge & Cleanup</h4>
|
<h4 class="mb-0"><i class="bi bi-trash3 me-2 text-danger"></i>Data Purge & Cleanup</h4>
|
||||||
|
|||||||
@@ -18,7 +18,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="mb-4"></div>
|
<div class="mb-2">
|
||||||
|
<a asp-controller="PlatformAdmin" asp-action="Maintenance" class="text-muted small text-decoration-none">
|
||||||
|
<i class="bi bi-arrow-left me-1"></i>Maintenance
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (TempData["SuccessMessage"] != null)
|
@if (TempData["SuccessMessage"] != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
<div class="mb-2">
|
||||||
|
<a asp-controller="PlatformAdmin" asp-action="Maintenance" class="text-muted small text-decoration-none">
|
||||||
|
<i class="bi bi-arrow-left me-1"></i>Maintenance
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row g-4">
|
<div class="row g-4">
|
||||||
<!-- Status Card -->
|
<!-- Status Card -->
|
||||||
|
|||||||
Reference in New Issue
Block a user