diff --git a/packages/reservation-platform/src/server/actions/printJobs.ts b/packages/reservation-platform/src/server/actions/printJobs.ts index 4c5e040..ad518dc 100644 --- a/packages/reservation-platform/src/server/actions/printJobs.ts +++ b/packages/reservation-platform/src/server/actions/printJobs.ts @@ -91,7 +91,7 @@ export async function abortPrintJob(jobId: string, reason: string) { // Check if user is the owner of the print job // biome-ignore lint/style/noNonNullAssertion: guard already checks against null - if (printJob.userId !== dbUser!.id || dbUser!.role !== UserRole.ADMIN) { + if (printJob.userId !== dbUser!.id && dbUser!.role !== UserRole.ADMIN) { throw new PermissionError(); } @@ -147,7 +147,7 @@ export async function earlyFinishPrintJob(jobId: string) { // Check if user is the owner of the print job // biome-ignore lint/style/noNonNullAssertion: guard already checks against null - if (printJob.userId !== dbUser!.id || dbUser!.role !== UserRole.ADMIN) { + if (printJob.userId !== dbUser!.id && dbUser!.role !== UserRole.ADMIN) { throw new PermissionError(); } @@ -201,7 +201,7 @@ export async function extendPrintJob(jobId: string, minutes: number, hours: numb // Check if user is the owner of the print job // biome-ignore lint/style/noNonNullAssertion: guard already checks against null - if (printJob.userId !== dbUser!.id || dbUser!.role !== UserRole.ADMIN) { + if (printJob.userId !== dbUser!.id && dbUser!.role !== UserRole.ADMIN) { throw new PermissionError(); } @@ -254,7 +254,7 @@ export async function updatePrintComments(jobId: string, comments: string) { // Check if user is the owner of the print job // biome-ignore lint/style/noNonNullAssertion: guard already checks against null - if (printJob.userId !== dbUser!.id || dbUser!.role !== UserRole.ADMIN) { + if (printJob.userId !== dbUser!.id && dbUser!.role !== UserRole.ADMIN) { throw new PermissionError(); }