feat: RBAC Phase 2d - Auswertung & Ausgabe auf @RequirePermission umgestellt

Dashboard, Search, Calendar, Statistics, Qr, Export, Documents:
@Roles(...) durch @RequirePermission(...) ersetzt bzw. neu eingefuehrt
(alle diese Controller hatten zuvor gar keine Rollenpruefung -
jeder eingeloggte Nutzer konnte lesen). Documents behaelt STAFF-Zugriff
auf Upload und Loeschen.

Verifiziert: tsc, lint, volle e2e-Suite 158/159 gruen (1 getrackter Skip).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Sonnet 5 committed 2026-08-26 07:09:20 +02:00
1 parent c510304813
commit 8832081973
7 files changed
+28 -4

No files matched your search

@@ -1,6 +1,7 @@
import { Controller, Get, Param, Query, Res } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import type { Response } from 'express';
import { RequirePermission } from '../auth/decorators/require-permission.decorator';
import { ExportService } from './export.service';
@ApiTags('export')
@@ -9,6 +10,7 @@ import { ExportService } from './export.service';
export class ExportController {
constructor(private readonly exportService: ExportService) {}
@RequirePermission('export:read')
@Get('colonies.csv')
async colonies(@Res() res: Response): Promise<void> {
const csv = await this.exportService.exportColoniesCsv();
@@ -17,6 +19,7 @@ export class ExportController {
res.send(csv);
}
@RequirePermission('export:read')
@Get('honey-batches.csv')
async honeyBatches(@Res() res: Response): Promise<void> {
const csv = await this.exportService.exportHoneyBatchesCsv();
@@ -28,6 +31,7 @@ export class ExportController {
res.send(csv);
}
@RequirePermission('export:read')
@Get(':entity.json')
async entityJson(
@Param('entity') entity: string,
@@ -42,6 +46,7 @@ export class ExportController {
res.send(JSON.stringify(data, null, 2));
}
@RequirePermission('export:read')
@Get(':report.pdf')
async reportPdf(
@Param('report') report: string,