feat: Wahl-Phasen, Verantwortliche-Invites, Auth fixes, GRUPPE chat #1

Merged
linus merged 28 commits from feat/backend-phases-0-6 into main 2026-09-12 11:26:16 +00:00
2 changed files with 9 additions and 9 deletions
Showing only changes of commit 6f4a446ae4 - Show all commits
+1 -1
View File
@@ -34,7 +34,7 @@ export class FilesController {
/// Only the Leitungsteam uploads files (per KC), tagged with a visibility tier. /// Only the Leitungsteam uploads files (per KC), tagged with a visibility tier.
@Post(':kcId') @Post(':kcId')
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
@UseInterceptors(FileInterceptor('file')) @UseInterceptors(FileInterceptor('file'))
upload( upload(
+8 -8
View File
@@ -32,35 +32,35 @@ export class WahlController {
/// Wahl-/Workshop-/Force-Zuteilung-Verwaltung ist ausschließlich Sache des /// Wahl-/Workshop-/Force-Zuteilung-Verwaltung ist ausschließlich Sache des
/// Leitungsteams (global über alle KCs, siehe RolesGuard). /// Leitungsteams (global über alle KCs, siehe RolesGuard).
@Post() @Post()
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
createWahl(@Body() dto: CreateWahlDto) { createWahl(@Body() dto: CreateWahlDto) {
return this.wahl.createWahl(dto.kcId, dto.name, dto.datumsSchluessel, dto.teil); return this.wahl.createWahl(dto.kcId, dto.name, dto.datumsSchluessel, dto.teil);
} }
@Get() @Get()
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
listWahlen(@Query('kcId') kcId: string) { listWahlen(@Query('kcId') kcId: string) {
return this.wahl.listWahlen(kcId); return this.wahl.listWahlen(kcId);
} }
@Post(':wahlId/workshops') @Post(':wahlId/workshops')
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
createWorkshop(@Param('wahlId') wahlId: string, @Body() dto: CreateWorkshopDto) { createWorkshop(@Param('wahlId') wahlId: string, @Body() dto: CreateWorkshopDto) {
return this.wahl.createWorkshop(wahlId, dto.name, dto.kapazitaet, dto.minTeilnehmer); return this.wahl.createWorkshop(wahlId, dto.name, dto.kapazitaet, dto.minTeilnehmer);
} }
@Get(':wahlId/workshops') @Get(':wahlId/workshops')
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
listWorkshops(@Param('wahlId') wahlId: string) { listWorkshops(@Param('wahlId') wahlId: string) {
return this.wahl.listWorkshops(wahlId); return this.wahl.listWorkshops(wahlId);
} }
@Post(':wahlId/force-zuteilung') @Post(':wahlId/force-zuteilung')
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
createForceZuteilung( createForceZuteilung(
@Param('wahlId') wahlId: string, @Param('wahlId') wahlId: string,
@@ -99,21 +99,21 @@ export class WahlController {
} }
@Post(':wahlId/zuteilung/run') @Post(':wahlId/zuteilung/run')
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
runZuteilung(@Param('wahlId') wahlId: string) { runZuteilung(@Param('wahlId') wahlId: string) {
return this.zuteilung.run(wahlId); return this.zuteilung.run(wahlId);
} }
@Get(':wahlId/zuteilung') @Get(':wahlId/zuteilung')
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
getZuteilung(@Param('wahlId') wahlId: string) { getZuteilung(@Param('wahlId') wahlId: string) {
return this.zuteilung.getResults(wahlId); return this.zuteilung.getResults(wahlId);
} }
@Get(':wahlId/zuteilung/csv') @Get(':wahlId/zuteilung/csv')
@UseGuards(AuthGuard('authentik'), RolesGuard) @UseGuards(AuthGuard(['authentik', 'team']), RolesGuard)
@Roles(Role.LEITUNGSTEAM) @Roles(Role.LEITUNGSTEAM)
async exportCsv(@Param('wahlId') wahlId: string, @Res() res: Response) { async exportCsv(@Param('wahlId') wahlId: string, @Res() res: Response) {
const csv = await this.zuteilung.exportCsv(wahlId); const csv = await this.zuteilung.exportCsv(wahlId);