From 58c5778bfbcac79f636d9254acee4af5f52263c7 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 4 Apr 2026 14:00:03 -0400 Subject: [PATCH] Remove stale per-page Authorize(Roles) attributes All 26 pages had @attribute [Authorize(Roles = "Admin,SuperAdmin")] which conflicts with the Keycloak role sor-admin. The fallback policy in Program.cs already enforces RequireRole("sor-admin") globally, making these attributes redundant. Removing them fixes Access Denied for all admin pages. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../src/SOR.Admin/Components/Pages/Accounts/AccountCreate.razor | 1 - .../src/SOR.Admin/Components/Pages/Accounts/AccountDetail.razor | 1 - Server/src/SOR.Admin/Components/Pages/Accounts/AccountList.razor | 1 - .../src/SOR.Admin/Components/Pages/Bazaar/BazaarOverview.razor | 1 - .../SOR.Admin/Components/Pages/Bazaar/BoosterPackEditor.razor | 1 - .../src/SOR.Admin/Components/Pages/Bazaar/BoosterPackList.razor | 1 - .../src/SOR.Admin/Components/Pages/Bazaar/CosmeticEditor.razor | 1 - Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticsPage.razor | 1 - .../SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckEditor.razor | 1 - .../src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckList.razor | 1 - .../SOR.Admin/Components/Pages/Bazaar/PurchaseRecordsPage.razor | 1 - Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor | 1 - Server/src/SOR.Admin/Components/Pages/Cards/CardList.razor | 1 - .../Components/Pages/Collection/CollectionOverview.razor | 1 - .../Components/Pages/Collection/PlayerCollectionDetail.razor | 1 - Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor | 1 - Server/src/SOR.Admin/Components/Pages/Content/AudioConfig.razor | 1 - Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor | 1 - .../SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor | 1 - .../SOR.Admin/Components/Pages/Content/SkyboxManagerPage.razor | 1 - .../Components/Pages/Content/TileModelManagerPage.razor | 1 - Server/src/SOR.Admin/Components/Pages/Dashboard.razor | 1 - Server/src/SOR.Admin/Components/Pages/FeatureFlags.razor | 1 - .../SOR.Admin/Components/Pages/Game/GameSessionDetailPage.razor | 1 - .../src/SOR.Admin/Components/Pages/Game/GameSessionsPage.razor | 1 - .../SOR.Admin/Components/Pages/Game/MatchmakingQueuePage.razor | 1 - 26 files changed, 26 deletions(-) diff --git a/Server/src/SOR.Admin/Components/Pages/Accounts/AccountCreate.razor b/Server/src/SOR.Admin/Components/Pages/Accounts/AccountCreate.razor index 3a0bdd5..d44cdf7 100644 --- a/Server/src/SOR.Admin/Components/Pages/Accounts/AccountCreate.razor +++ b/Server/src/SOR.Admin/Components/Pages/Accounts/AccountCreate.razor @@ -1,5 +1,4 @@ @page "/accounts/new" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject UserManager UserManager @inject RoleManager> RoleManager @inject NavigationManager Nav diff --git a/Server/src/SOR.Admin/Components/Pages/Accounts/AccountDetail.razor b/Server/src/SOR.Admin/Components/Pages/Accounts/AccountDetail.razor index 9188301..923f26f 100644 --- a/Server/src/SOR.Admin/Components/Pages/Accounts/AccountDetail.razor +++ b/Server/src/SOR.Admin/Components/Pages/Accounts/AccountDetail.razor @@ -1,5 +1,4 @@ @page "/accounts/{Id:guid}" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject SorIdentityDbContext Db @inject CatalogDbContext CatalogDb @inject CollectionDbContext CollectionDb diff --git a/Server/src/SOR.Admin/Components/Pages/Accounts/AccountList.razor b/Server/src/SOR.Admin/Components/Pages/Accounts/AccountList.razor index 607d9b7..c81b7a6 100644 --- a/Server/src/SOR.Admin/Components/Pages/Accounts/AccountList.razor +++ b/Server/src/SOR.Admin/Components/Pages/Accounts/AccountList.razor @@ -1,5 +1,4 @@ @page "/accounts" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject SorIdentityDbContext Db @inject NavigationManager Nav diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/BazaarOverview.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/BazaarOverview.razor index 03e5bd2..c1cc841 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/BazaarOverview.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/BazaarOverview.razor @@ -1,5 +1,4 @@ @page "/bazaar" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject BazaarDbContext Db Bazaar – SOR Admin diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackEditor.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackEditor.razor index 2517f2e..4f08b17 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackEditor.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackEditor.razor @@ -1,6 +1,5 @@ @page "/bazaar/packs/new" @page "/bazaar/packs/{Id:guid}" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject BazaarDbContext Db @inject CatalogDbContext CatalogDb @inject SOR.Cdn.ICdnClient Cdn diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackList.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackList.razor index 2771f9e..ec89461 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackList.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/BoosterPackList.razor @@ -1,5 +1,4 @@ @page "/bazaar/packs" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject BazaarDbContext Db @inject NavigationManager Nav diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticEditor.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticEditor.razor index b3317f3..25e93a4 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticEditor.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticEditor.razor @@ -1,6 +1,5 @@ @page "/bazaar/cosmetics/new" @page "/bazaar/cosmetics/{Id:guid}" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Entities.Bazaar diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticsPage.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticsPage.razor index e89c9bd..27398c1 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticsPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/CosmeticsPage.razor @@ -1,5 +1,4 @@ @page "/bazaar/cosmetics" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Enums diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckEditor.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckEditor.razor index 1d5de46..a0a52cc 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckEditor.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckEditor.razor @@ -1,6 +1,5 @@ @page "/bazaar/decks/new" @page "/bazaar/decks/{Id:guid}" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject BazaarDbContext Db @inject CatalogDbContext CatalogDb @inject SOR.Cdn.ICdnClient Cdn diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckList.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckList.razor index 09c0902..a020899 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckList.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/PrebuiltDeckList.razor @@ -1,5 +1,4 @@ @page "/bazaar/decks" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject BazaarDbContext Db Prebuilt Decks – SOR Admin diff --git a/Server/src/SOR.Admin/Components/Pages/Bazaar/PurchaseRecordsPage.razor b/Server/src/SOR.Admin/Components/Pages/Bazaar/PurchaseRecordsPage.razor index 9da4991..c507b28 100644 --- a/Server/src/SOR.Admin/Components/Pages/Bazaar/PurchaseRecordsPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Bazaar/PurchaseRecordsPage.razor @@ -1,5 +1,4 @@ @page "/bazaar/purchases" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Enums diff --git a/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor b/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor index 746f9cd..1782a0f 100644 --- a/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor +++ b/Server/src/SOR.Admin/Components/Pages/Cards/CardEditor.razor @@ -1,6 +1,5 @@ @page "/cards/new" @page "/cards/{Id:guid}" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @implements IDisposable @inject CatalogDbContext Db @inject NavigationManager Nav diff --git a/Server/src/SOR.Admin/Components/Pages/Cards/CardList.razor b/Server/src/SOR.Admin/Components/Pages/Cards/CardList.razor index d19cc28..89f7b8a 100644 --- a/Server/src/SOR.Admin/Components/Pages/Cards/CardList.razor +++ b/Server/src/SOR.Admin/Components/Pages/Cards/CardList.razor @@ -1,5 +1,4 @@ @page "/cards" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject CatalogDbContext Db @inject NavigationManager Nav diff --git a/Server/src/SOR.Admin/Components/Pages/Collection/CollectionOverview.razor b/Server/src/SOR.Admin/Components/Pages/Collection/CollectionOverview.razor index aa46d3e..cf35b31 100644 --- a/Server/src/SOR.Admin/Components/Pages/Collection/CollectionOverview.razor +++ b/Server/src/SOR.Admin/Components/Pages/Collection/CollectionOverview.razor @@ -1,5 +1,4 @@ @page "/collection" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject CollectionDbContext CollectionDb @inject NavigationManager Nav diff --git a/Server/src/SOR.Admin/Components/Pages/Collection/PlayerCollectionDetail.razor b/Server/src/SOR.Admin/Components/Pages/Collection/PlayerCollectionDetail.razor index 65223f5..f81bcf1 100644 --- a/Server/src/SOR.Admin/Components/Pages/Collection/PlayerCollectionDetail.razor +++ b/Server/src/SOR.Admin/Components/Pages/Collection/PlayerCollectionDetail.razor @@ -1,5 +1,4 @@ @page "/collection/player/{AccountId:guid}" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject CollectionDbContext CollectionDb @inject CatalogDbContext CatalogDb @inject SOR.Database.Contexts.SorIdentityDbContext IdentityDb diff --git a/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor b/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor index 27aadc1..5c87acd 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor @@ -1,5 +1,4 @@ @page "/content/ai-assets" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Entities.Catalog diff --git a/Server/src/SOR.Admin/Components/Pages/Content/AudioConfig.razor b/Server/src/SOR.Admin/Components/Pages/Content/AudioConfig.razor index c71f961..3eebf9e 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/AudioConfig.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/AudioConfig.razor @@ -1,5 +1,4 @@ @page "/content/audio" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Entities.Catalog diff --git a/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor b/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor index 7653838..c56049b 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor @@ -1,5 +1,4 @@ @page "/content/cdn" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @implements IDisposable @using Amazon.S3 @using Amazon.S3.Model diff --git a/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor b/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor index 1c9d130..f289fc2 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor @@ -1,5 +1,4 @@ @page "/content/highlights" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Entities.Catalog diff --git a/Server/src/SOR.Admin/Components/Pages/Content/SkyboxManagerPage.razor b/Server/src/SOR.Admin/Components/Pages/Content/SkyboxManagerPage.razor index 674a4e1..a465317 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/SkyboxManagerPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/SkyboxManagerPage.razor @@ -1,5 +1,4 @@ @page "/content/skyboxes" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Entities.Catalog diff --git a/Server/src/SOR.Admin/Components/Pages/Content/TileModelManagerPage.razor b/Server/src/SOR.Admin/Components/Pages/Content/TileModelManagerPage.razor index 3b0c983..a6c535e 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/TileModelManagerPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/TileModelManagerPage.razor @@ -1,5 +1,4 @@ @page "/content/tile-models" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Amazon.S3 @using Amazon.S3.Model @using Microsoft.EntityFrameworkCore diff --git a/Server/src/SOR.Admin/Components/Pages/Dashboard.razor b/Server/src/SOR.Admin/Components/Pages/Dashboard.razor index ce1c029..6959b12 100644 --- a/Server/src/SOR.Admin/Components/Pages/Dashboard.razor +++ b/Server/src/SOR.Admin/Components/Pages/Dashboard.razor @@ -1,5 +1,4 @@ @page "/" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @inject CatalogDbContext CatalogDb @inject SorIdentityDbContext IdentityDb @inject BazaarDbContext BazaarDb diff --git a/Server/src/SOR.Admin/Components/Pages/FeatureFlags.razor b/Server/src/SOR.Admin/Components/Pages/FeatureFlags.razor index c923a14..826b0c0 100644 --- a/Server/src/SOR.Admin/Components/Pages/FeatureFlags.razor +++ b/Server/src/SOR.Admin/Components/Pages/FeatureFlags.razor @@ -1,5 +1,4 @@ @page "/feature-flags" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] Feature Flags – SOR Admin diff --git a/Server/src/SOR.Admin/Components/Pages/Game/GameSessionDetailPage.razor b/Server/src/SOR.Admin/Components/Pages/Game/GameSessionDetailPage.razor index c921af3..2e92ffc 100644 --- a/Server/src/SOR.Admin/Components/Pages/Game/GameSessionDetailPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Game/GameSessionDetailPage.razor @@ -1,5 +1,4 @@ @page "/game/sessions/{Id:guid}" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using System.Text.Json @using SOR.Database.Contexts diff --git a/Server/src/SOR.Admin/Components/Pages/Game/GameSessionsPage.razor b/Server/src/SOR.Admin/Components/Pages/Game/GameSessionsPage.razor index 18c847f..ec37cc9 100644 --- a/Server/src/SOR.Admin/Components/Pages/Game/GameSessionsPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Game/GameSessionsPage.razor @@ -1,5 +1,4 @@ @page "/game/sessions" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Enums diff --git a/Server/src/SOR.Admin/Components/Pages/Game/MatchmakingQueuePage.razor b/Server/src/SOR.Admin/Components/Pages/Game/MatchmakingQueuePage.razor index 331a688..eb684cd 100644 --- a/Server/src/SOR.Admin/Components/Pages/Game/MatchmakingQueuePage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Game/MatchmakingQueuePage.razor @@ -1,5 +1,4 @@ @page "/game/matchmaking" -@attribute [Authorize(Roles = "Admin,SuperAdmin")] @using Microsoft.EntityFrameworkCore @using SOR.Database.Contexts @using SOR.Database.Enums