From cd7e9b86b4b9d3e1ef0312f6fff436fcef4a5c94 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sun, 24 Jan 2021 18:43:29 +0100 Subject: [PATCH] =?UTF-8?q?Renamedpermisssions=20from=20*Organisation*=20t?= =?UTF-8?q?o=20*Organization*=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #117 --- src/controllers/RunnerOrganizationController.ts | 10 +++++----- src/middlewares/StatsAuth.ts | 2 +- src/models/enums/PermissionTargets.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/controllers/RunnerOrganizationController.ts b/src/controllers/RunnerOrganizationController.ts index b4dcc70..b39e3cc 100644 --- a/src/controllers/RunnerOrganizationController.ts +++ b/src/controllers/RunnerOrganizationController.ts @@ -24,7 +24,7 @@ export class RunnerOrganizationController { } @Get() - @Authorized("ORGANISATION:GET") + @Authorized("ORGANIZATION:GET") @ResponseSchema(ResponseRunnerOrganization, { isArray: true }) @OpenAPI({ description: 'Lists all organizations.
This includes their address, contact and teams (if existing/associated).' }) async getAll() { @@ -37,7 +37,7 @@ export class RunnerOrganizationController { } @Get('/:id') - @Authorized("ORGANISATION:GET") + @Authorized("ORGANIZATION:GET") @ResponseSchema(ResponseRunnerOrganization) @ResponseSchema(RunnerOrganizationNotFoundError, { statusCode: 404 }) @OnUndefined(RunnerOrganizationNotFoundError) @@ -49,7 +49,7 @@ export class RunnerOrganizationController { } @Post() - @Authorized("ORGANISATION:CREATE") + @Authorized("ORGANIZATION:CREATE") @ResponseSchema(ResponseRunnerOrganization) @OpenAPI({ description: 'Create a new organsisation.' }) async post(@Body({ validate: true }) createRunnerOrganization: CreateRunnerOrganization) { @@ -66,7 +66,7 @@ export class RunnerOrganizationController { } @Put('/:id') - @Authorized("ORGANISATION:UPDATE") + @Authorized("ORGANIZATION:UPDATE") @ResponseSchema(ResponseRunnerOrganization) @ResponseSchema(RunnerOrganizationNotFoundError, { statusCode: 404 }) @ResponseSchema(RunnerOrganizationIdsNotMatchingError, { statusCode: 406 }) @@ -88,7 +88,7 @@ export class RunnerOrganizationController { } @Delete('/:id') - @Authorized("ORGANISATION:DELETE") + @Authorized("ORGANIZATION:DELETE") @ResponseSchema(ResponseRunnerOrganization) @ResponseSchema(ResponseEmpty, { statusCode: 204 }) @ResponseSchema(RunnerOrganizationHasTeamsError, { statusCode: 406 }) diff --git a/src/middlewares/StatsAuth.ts b/src/middlewares/StatsAuth.ts index a6928be..3a40db0 100644 --- a/src/middlewares/StatsAuth.ts +++ b/src/middlewares/StatsAuth.ts @@ -42,7 +42,7 @@ const StatsAuth = async (req: Request, res: Response, next: () => void) => { let user_authorized = false; try { 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 { if (user_authorized == false) { diff --git a/src/models/enums/PermissionTargets.ts b/src/models/enums/PermissionTargets.ts index 1dac026..4bb9c1c 100644 --- a/src/models/enums/PermissionTargets.ts +++ b/src/models/enums/PermissionTargets.ts @@ -3,7 +3,7 @@ */ export enum PermissionTarget { RUNNER = 'RUNNER', - ORGANISATION = 'ORGANISATION', + ORGANIZATION = 'ORGANIZATION', TEAM = 'TEAM', TRACK = 'TRACK', USER = 'USER',