Renamedpermisssions from *Organisation* to *Organization*📝
All checks were successful
continuous-integration/drone/pr Build is passing

ref #117
This commit is contained in:
Nicolai Ort 2021-01-24 18:43:29 +01:00
parent c6c643ecf1
commit cd7e9b86b4
3 changed files with 7 additions and 7 deletions

View File

@ -24,7 +24,7 @@ export class RunnerOrganizationController {
} }
@Get() @Get()
@Authorized("ORGANISATION:GET") @Authorized("ORGANIZATION:GET")
@ResponseSchema(ResponseRunnerOrganization, { isArray: true }) @ResponseSchema(ResponseRunnerOrganization, { isArray: true })
@OpenAPI({ description: 'Lists all organizations. <br> This includes their address, contact and teams (if existing/associated).' }) @OpenAPI({ description: 'Lists all organizations. <br> This includes their address, contact and teams (if existing/associated).' })
async getAll() { async getAll() {
@ -37,7 +37,7 @@ export class RunnerOrganizationController {
} }
@Get('/:id') @Get('/:id')
@Authorized("ORGANISATION:GET") @Authorized("ORGANIZATION:GET")
@ResponseSchema(ResponseRunnerOrganization) @ResponseSchema(ResponseRunnerOrganization)
@ResponseSchema(RunnerOrganizationNotFoundError, { statusCode: 404 }) @ResponseSchema(RunnerOrganizationNotFoundError, { statusCode: 404 })
@OnUndefined(RunnerOrganizationNotFoundError) @OnUndefined(RunnerOrganizationNotFoundError)
@ -49,7 +49,7 @@ export class RunnerOrganizationController {
} }
@Post() @Post()
@Authorized("ORGANISATION:CREATE") @Authorized("ORGANIZATION:CREATE")
@ResponseSchema(ResponseRunnerOrganization) @ResponseSchema(ResponseRunnerOrganization)
@OpenAPI({ description: 'Create a new organsisation.' }) @OpenAPI({ description: 'Create a new organsisation.' })
async post(@Body({ validate: true }) createRunnerOrganization: CreateRunnerOrganization) { async post(@Body({ validate: true }) createRunnerOrganization: CreateRunnerOrganization) {
@ -66,7 +66,7 @@ export class RunnerOrganizationController {
} }
@Put('/:id') @Put('/:id')
@Authorized("ORGANISATION:UPDATE") @Authorized("ORGANIZATION:UPDATE")
@ResponseSchema(ResponseRunnerOrganization) @ResponseSchema(ResponseRunnerOrganization)
@ResponseSchema(RunnerOrganizationNotFoundError, { statusCode: 404 }) @ResponseSchema(RunnerOrganizationNotFoundError, { statusCode: 404 })
@ResponseSchema(RunnerOrganizationIdsNotMatchingError, { statusCode: 406 }) @ResponseSchema(RunnerOrganizationIdsNotMatchingError, { statusCode: 406 })
@ -88,7 +88,7 @@ export class RunnerOrganizationController {
} }
@Delete('/:id') @Delete('/:id')
@Authorized("ORGANISATION:DELETE") @Authorized("ORGANIZATION:DELETE")
@ResponseSchema(ResponseRunnerOrganization) @ResponseSchema(ResponseRunnerOrganization)
@ResponseSchema(ResponseEmpty, { statusCode: 204 }) @ResponseSchema(ResponseEmpty, { statusCode: 204 })
@ResponseSchema(RunnerOrganizationHasTeamsError, { statusCode: 406 }) @ResponseSchema(RunnerOrganizationHasTeamsError, { statusCode: 406 })

View File

@ -42,7 +42,7 @@ const StatsAuth = async (req: Request, res: Response, next: () => void) => {
let user_authorized = false; let user_authorized = false;
try { try {
let action = { request: req, response: res, context: null, next: next } let action = { request: req, response: res, context: null, next: next }
user_authorized = await authchecker(action, ["RUNNER:GET", "TEAM:GET", "ORGANISATION:GET"]); user_authorized = await authchecker(action, ["RUNNER:GET", "TEAM:GET", "ORGANIZATION:GET"]);
} }
finally { finally {
if (user_authorized == false) { if (user_authorized == false) {

View File

@ -3,7 +3,7 @@
*/ */
export enum PermissionTarget { export enum PermissionTarget {
RUNNER = 'RUNNER', RUNNER = 'RUNNER',
ORGANISATION = 'ORGANISATION', ORGANIZATION = 'ORGANIZATION',
TEAM = 'TEAM', TEAM = 'TEAM',
TRACK = 'TRACK', TRACK = 'TRACK',
USER = 'USER', USER = 'USER',