fix: fixed access to AdminSettings without being authorize #12

Merged
Penry merged 1 commits from FixAdminSettingsAuthorize into main 2025-12-22 17:49:57 +01:00
3 changed files with 12 additions and 1 deletions
Showing only changes of commit 216937c6ad - Show all commits

View File

@@ -1,5 +1,9 @@
@page "/AdminSettings" @page "/AdminSettings"
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin")]
<h3>Index</h3> <h3>Index</h3>
@code { @code {

View File

@@ -5,6 +5,7 @@
@using Microsoft.AspNetCore.Identity @using Microsoft.AspNetCore.Identity
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@using Microsoft.AspNetCore.Components.QuickGrid @using Microsoft.AspNetCore.Components.QuickGrid
@using Microsoft.AspNetCore.Authorization
@inject ApplicationDbContext CouchLogDB @inject ApplicationDbContext CouchLogDB
@inject UserManager<ApplicationUser> UserManager @inject UserManager<ApplicationUser> UserManager
@@ -12,6 +13,8 @@
@inject AuthenticationStateProvider AuthenticationStateProvider @inject AuthenticationStateProvider AuthenticationStateProvider
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@attribute [Authorize(Roles = "Admin")]
<div class="d-flex align-items-center justify-content-between"> <div class="d-flex align-items-center justify-content-between">
<h3 class="mb-0">UserManagement</h3> <h3 class="mb-0">UserManagement</h3>

View File

@@ -1,6 +1,10 @@
@inherits LayoutComponentBase @using Microsoft.AspNetCore.Authorization
@inherits LayoutComponentBase
@layout CouchLog.Components.Layout.MainLayout @layout CouchLog.Components.Layout.MainLayout
@attribute [Authorize(Roles = "Admin")]
<h1>Manage CouchLog</h1> <h1>Manage CouchLog</h1>
<div> <div>