Update VerificationSettingsDialog: restrict image viewing button to admin and ambassador users, and enhance delete confirmation message

This commit is contained in:
a.beging@eas-solutions.de
2026-04-23 09:17:40 +02:00
parent 04084b4bf7
commit cad9617451
2 changed files with 9 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
@using Blazorise @using Blazorise
@using FoodsharingSiegen.Contracts.Enums
@inherits FsBase @inherits FsBase
<div class="mt-1 mb-3"> <div class="mt-1 mb-3">
@@ -22,9 +23,13 @@
<i class="fa-solid fa-link me-2"></i> Upload-Link erstellen / anzeigen <i class="fa-solid fa-link me-2"></i> Upload-Link erstellen / anzeigen
</Button> </Button>
@if(CurrentUser.IsAdmin() || CurrentUser.IsInGroup(UserGroup.Ambassador))
{
<Button Color="Color.Success" Clicked="@ViewImagesAsync" Disabled="@(ImageCount == 0)"> <Button Color="Color.Success" Clicked="@ViewImagesAsync" Disabled="@(ImageCount == 0)">
<i class="fa-solid fa-images me-2"></i> Hochgeladene Bilder ansehen (@ImageCount) <i class="fa-solid fa-images me-2"></i> Hochgeladene Bilder ansehen (@ImageCount)
</Button> </Button>
}
<Button Color="Color.Danger" Clicked="@DeleteImagesAsync" Disabled="@(ImageCount == 0)"> <Button Color="Color.Danger" Clicked="@DeleteImagesAsync" Disabled="@(ImageCount == 0)">
<i class="fa-solid fa-trash-can me-2"></i> Alle Bilder löschen <i class="fa-solid fa-trash-can me-2"></i> Alle Bilder löschen

View File

@@ -95,7 +95,7 @@ namespace FoodsharingSiegen.Server.Dialogs
{ {
if (Prospect == null) return; if (Prospect == null) return;
await ConfirmDialog.ShowAsync(ModalService, "Bilder Löschen", "Sollen alle Identitätsprüfungsbilder dieses Users unwiderruflich gelöscht werden?", async () => await ConfirmDialog.ShowAsync(ModalService, "Bilder Löschen", $"Sollen alle Identitätsprüfungsbilder von {Prospect.Name} unwiderruflich gelöscht werden?", async () =>
{ {
var result = await ProspectService.DeleteVerificationImagesAsync(Prospect.Id); var result = await ProspectService.DeleteVerificationImagesAsync(Prospect.Id);
if (result.Success) if (result.Success)