From 4aedbc27d5667476a6d87cef1e06194d2be1b6df Mon Sep 17 00:00:00 2001 From: Despina Adamopoulou Date: Thu, 8 Aug 2024 11:50:58 +0200 Subject: [PATCH] rename variable --- src/jobs/jobs.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jobs/jobs.controller.ts b/src/jobs/jobs.controller.ts index 5197c14ee..0619a4f2f 100644 --- a/src/jobs/jobs.controller.ts +++ b/src/jobs/jobs.controller.ts @@ -737,10 +737,10 @@ export class JobsController { const ability = this.caslAbilityFactory.createForUser( request.user as JWTUser, ); - const canGet = + const canRead = ability.can(AuthOp.JobReadAny, JobClass) || ability.can(AuthOp.JobReadAccess, currentJobInstance); - if (!canGet) { + if (!canRead) { throw new ForbiddenException("Unauthorized to get this job."); } return currentJob;