Fixed wrong auth type being used

ref #67
This commit is contained in:
Nicolai Ort 2021-01-08 18:08:13 +01:00
parent db6fdf6baf
commit cf86520fae
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
import { getConnectionManager, Repository } from 'typeorm';
import { RunnerNotFoundError } from '../errors/RunnerErrors';
import { ScanIdsNotMatchingError, ScanNotFoundError } from '../errors/ScanErrors';
import StatsAuth from '../middlewares/StatsAuth';
import ScanAuth from '../middlewares/ScanAuth';
import { CreateScan } from '../models/actions/CreateScan';
import { CreateTrackScan } from '../models/actions/CreateTrackScan';
import { UpdateScan } from '../models/actions/UpdateScan';
@ -52,7 +52,7 @@ export class ScanController {
}
@Post()
@Authorized("SCAN:CREATE")
@UseBefore(ScanAuth)
@ResponseSchema(ResponseScan)
@OpenAPI({ description: 'Create a new runner. <br> Please remeber to provide the runner\'s group\'s id.' })
async post(@Body({ validate: true }) createScan: CreateScan) {
@ -62,7 +62,7 @@ export class ScanController {
}
@Post("/trackscans")
@UseBefore(StatsAuth)
@UseBefore(ScanAuth)
@ResponseSchema(ResponseScan)
@OpenAPI({ description: 'Create a new track scan. <br> This is just a alias for posting /scans' })
async postTrackScans(@Body({ validate: true }) createScan: CreateTrackScan) {