From 433090effda2ad946b480c014dfa62d9a210fe05 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Tue, 12 May 2026 20:50:11 -0400 Subject: [PATCH] PR 2: normalize DiagnosticsController auth; add Maintenance back-links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/PowderCoating.Web/Controllers/DiagnosticsController.cs | 3 ++- src/PowderCoating.Web/Views/DataExport/Index.cshtml | 5 +++++ src/PowderCoating.Web/Views/DataPurge/Index.cshtml | 5 +++++ src/PowderCoating.Web/Views/SeedData/Index.cshtml | 6 +++++- src/PowderCoating.Web/Views/StorageMigration/Index.cshtml | 5 +++++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/PowderCoating.Web/Controllers/DiagnosticsController.cs b/src/PowderCoating.Web/Controllers/DiagnosticsController.cs index 13167bb..b92be76 100644 --- a/src/PowderCoating.Web/Controllers/DiagnosticsController.cs +++ b/src/PowderCoating.Web/Controllers/DiagnosticsController.cs @@ -1,11 +1,12 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using PowderCoating.Shared.Constants; using System.Reflection; using System.Security.Principal; namespace PowderCoating.Web.Controllers; -[Authorize(Roles = "SuperAdmin,Administrator")] +[Authorize(Policy = AppConstants.Policies.SuperAdminOnly)] public class DiagnosticsController : Controller { private readonly ILogger _logger; diff --git a/src/PowderCoating.Web/Views/DataExport/Index.cshtml b/src/PowderCoating.Web/Views/DataExport/Index.cshtml index 9d48d5f..b53bd9f 100644 --- a/src/PowderCoating.Web/Views/DataExport/Index.cshtml +++ b/src/PowderCoating.Web/Views/DataExport/Index.cshtml @@ -29,6 +29,11 @@ }
+

Data Export

diff --git a/src/PowderCoating.Web/Views/DataPurge/Index.cshtml b/src/PowderCoating.Web/Views/DataPurge/Index.cshtml index 07f1c24..cbecb3d 100644 --- a/src/PowderCoating.Web/Views/DataPurge/Index.cshtml +++ b/src/PowderCoating.Web/Views/DataPurge/Index.cshtml @@ -34,6 +34,11 @@ }
+

Data Purge & Cleanup

diff --git a/src/PowderCoating.Web/Views/SeedData/Index.cshtml b/src/PowderCoating.Web/Views/SeedData/Index.cshtml index da42fd9..fd459e9 100644 --- a/src/PowderCoating.Web/Views/SeedData/Index.cshtml +++ b/src/PowderCoating.Web/Views/SeedData/Index.cshtml @@ -18,7 +18,11 @@ }
-
+ @if (TempData["SuccessMessage"] != null) { diff --git a/src/PowderCoating.Web/Views/StorageMigration/Index.cshtml b/src/PowderCoating.Web/Views/StorageMigration/Index.cshtml index 82e2e86..64fb795 100644 --- a/src/PowderCoating.Web/Views/StorageMigration/Index.cshtml +++ b/src/PowderCoating.Web/Views/StorageMigration/Index.cshtml @@ -6,6 +6,11 @@ }