change permission error
This commit is contained in:
parent
e6e61e5f9b
commit
87606b9b9b
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user