K21 fertig. Änderungen:

1. AuthState.cs:68 - IsClubTreasurer Property hinzugefügt
  2. AuthState.cs:100,116,123,132 - Initial + WithPermissions um Treasurer erweitert
  3. NavMenu.razor:25-48 - Kassenbuch NavGroup mit 3 Links:
    - Übersicht (/cashbook)
    - Kategorien (/cashbook/categories)
    - Berichte (/cashbook/reports)

  Sichtbar für: Kassenwart, Admin, SuperAdmin
This commit is contained in:
beo3000 2026-01-04 10:01:07 +01:00
parent 0d94d4c5c0
commit b5caa75980
3 changed files with 33 additions and 1 deletions

View File

@ -1719,7 +1719,7 @@ public enum CashBookEntryType { Income = 0, Expense = 1 }
| ✓ | K18 | Web | Export Controller | 1 |
| ✓ | K19 | Web | Membership Fees Feature | 2 |
| ✓ | K20 | Web | Club Settings Extension | 3 |
| | K21 | Web | Navigation Integration | 1 |
| | K21 | Web | Navigation Integration | 1 |
| ☐ | K22 | Tests | Unit Tests | 2 |
| ☐ | K23 | Tests | Integration Tests | 1 |

View File

@ -22,7 +22,30 @@
Spieltage
</MudNavLink>
@if (AuthState.Value.IsClubTreasurer || AuthState.Value.IsClubAdmin || AuthState.Value.IsSuperAdmin)
{
<MudNavGroup Title="Kassenbuch"
Icon="@Icons.Material.Filled.AccountBalance"
Expanded="false">
<MudNavLink Href="/cashbook"
Match="NavLinkMatch.All"
Icon="@Icons.Material.Filled.Book">
&Uuml;bersicht
</MudNavLink>
<MudNavLink Href="/cashbook/categories"
Match="NavLinkMatch.Prefix"
Icon="@Icons.Material.Filled.Category">
Kategorien
</MudNavLink>
<MudNavLink Href="/cashbook/reports"
Match="NavLinkMatch.Prefix"
Icon="@Icons.Material.Filled.Assessment">
Berichte
</MudNavLink>
</MudNavGroup>
}
@if (AuthState.Value.IsClubAdmin || AuthState.Value.IsSuperAdmin)
{

View File

@ -62,6 +62,11 @@ public record AuthState
/// </summary>
public bool IsClubAdmin { get; set; }
/// <summary>
/// Whether the user is a Club Treasurer (Kassenwart).
/// </summary>
public bool IsClubTreasurer { get; set; }
/// <summary>
/// Whether the user is a Club Editor.
/// </summary>
@ -92,6 +97,7 @@ public record AuthState
AvailableClubs = [],
IsSuperAdmin = false,
IsClubAdmin = false,
IsClubTreasurer = false,
IsClubEditor = false,
IsClubViewer = false,
Roles = [],
@ -107,12 +113,14 @@ public record AuthState
{
var isSuperAdmin = roles.Contains(UserRole.SuperAdmin);
var isClubAdmin = roles.Contains(UserRole.Admin);
var isClubTreasurer = roles.Contains(UserRole.Treasurer);
var isClubEditor = roles.Contains(UserRole.Editor);
var isClubViewer = roles.Contains(UserRole.Viewer);
var highestRole = string.Empty;
if (isSuperAdmin) highestRole = UserRole.SuperAdmin;
else if (isClubAdmin) highestRole = UserRole.Admin;
else if (isClubTreasurer) highestRole = UserRole.Treasurer;
else if (isClubEditor) highestRole = UserRole.Editor;
else highestRole = UserRole.Viewer;
@ -121,6 +129,7 @@ public record AuthState
Roles = roles,
IsSuperAdmin = isSuperAdmin,
IsClubAdmin = isClubAdmin,
IsClubTreasurer = isClubTreasurer,
IsClubEditor = isClubEditor,
IsClubViewer = isClubViewer,
HighestRole = highestRole