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:
parent
0d94d4c5c0
commit
b5caa75980
|
|
@ -1719,7 +1719,7 @@ public enum CashBookEntryType { Income = 0, Expense = 1 }
|
||||||
| ✓ | K18 | Web | Export Controller | 1 |
|
| ✓ | K18 | Web | Export Controller | 1 |
|
||||||
| ✓ | K19 | Web | Membership Fees Feature | 2 |
|
| ✓ | K19 | Web | Membership Fees Feature | 2 |
|
||||||
| ✓ | K20 | Web | Club Settings Extension | 3 |
|
| ✓ | K20 | Web | Club Settings Extension | 3 |
|
||||||
| ☐ | K21 | Web | Navigation Integration | 1 |
|
| ✓ | K21 | Web | Navigation Integration | 1 |
|
||||||
| ☐ | K22 | Tests | Unit Tests | 2 |
|
| ☐ | K22 | Tests | Unit Tests | 2 |
|
||||||
| ☐ | K23 | Tests | Integration Tests | 1 |
|
| ☐ | K23 | Tests | Integration Tests | 1 |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,30 @@
|
||||||
Spieltage
|
Spieltage
|
||||||
</MudNavLink>
|
</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">
|
||||||
|
Ü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)
|
@if (AuthState.Value.IsClubAdmin || AuthState.Value.IsSuperAdmin)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,11 @@ public record AuthState
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsClubAdmin { get; set; }
|
public bool IsClubAdmin { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the user is a Club Treasurer (Kassenwart).
|
||||||
|
/// </summary>
|
||||||
|
public bool IsClubTreasurer { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the user is a Club Editor.
|
/// Whether the user is a Club Editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -92,6 +97,7 @@ public record AuthState
|
||||||
AvailableClubs = [],
|
AvailableClubs = [],
|
||||||
IsSuperAdmin = false,
|
IsSuperAdmin = false,
|
||||||
IsClubAdmin = false,
|
IsClubAdmin = false,
|
||||||
|
IsClubTreasurer = false,
|
||||||
IsClubEditor = false,
|
IsClubEditor = false,
|
||||||
IsClubViewer = false,
|
IsClubViewer = false,
|
||||||
Roles = [],
|
Roles = [],
|
||||||
|
|
@ -107,12 +113,14 @@ public record AuthState
|
||||||
{
|
{
|
||||||
var isSuperAdmin = roles.Contains(UserRole.SuperAdmin);
|
var isSuperAdmin = roles.Contains(UserRole.SuperAdmin);
|
||||||
var isClubAdmin = roles.Contains(UserRole.Admin);
|
var isClubAdmin = roles.Contains(UserRole.Admin);
|
||||||
|
var isClubTreasurer = roles.Contains(UserRole.Treasurer);
|
||||||
var isClubEditor = roles.Contains(UserRole.Editor);
|
var isClubEditor = roles.Contains(UserRole.Editor);
|
||||||
var isClubViewer = roles.Contains(UserRole.Viewer);
|
var isClubViewer = roles.Contains(UserRole.Viewer);
|
||||||
|
|
||||||
var highestRole = string.Empty;
|
var highestRole = string.Empty;
|
||||||
if (isSuperAdmin) highestRole = UserRole.SuperAdmin;
|
if (isSuperAdmin) highestRole = UserRole.SuperAdmin;
|
||||||
else if (isClubAdmin) highestRole = UserRole.Admin;
|
else if (isClubAdmin) highestRole = UserRole.Admin;
|
||||||
|
else if (isClubTreasurer) highestRole = UserRole.Treasurer;
|
||||||
else if (isClubEditor) highestRole = UserRole.Editor;
|
else if (isClubEditor) highestRole = UserRole.Editor;
|
||||||
else highestRole = UserRole.Viewer;
|
else highestRole = UserRole.Viewer;
|
||||||
|
|
||||||
|
|
@ -121,6 +129,7 @@ public record AuthState
|
||||||
Roles = roles,
|
Roles = roles,
|
||||||
IsSuperAdmin = isSuperAdmin,
|
IsSuperAdmin = isSuperAdmin,
|
||||||
IsClubAdmin = isClubAdmin,
|
IsClubAdmin = isClubAdmin,
|
||||||
|
IsClubTreasurer = isClubTreasurer,
|
||||||
IsClubEditor = isClubEditor,
|
IsClubEditor = isClubEditor,
|
||||||
IsClubViewer = isClubViewer,
|
IsClubViewer = isClubViewer,
|
||||||
HighestRole = highestRole
|
HighestRole = highestRole
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue