From 6250a84327c67dc49bc9564e286a7c59e1a7b07f Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:14:44 +0700 Subject: [PATCH] fix: also not include self if inactive --- src/services/permission.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/permission.ts b/src/services/permission.ts index 6bf3d60..8df8f99 100644 --- a/src/services/permission.ts +++ b/src/services/permission.ts @@ -61,6 +61,7 @@ export function createPermCondition( }, } : undefined, + status: opts?.activeOnly ? { not: Status.INACTIVE } : undefined, }, { headOffice: globalAllow(user) @@ -69,6 +70,7 @@ export function createPermCondition( user: { some: { userId: user.sub } }, } : undefined, + status: opts?.activeOnly ? { not: Status.INACTIVE } : undefined, }, ]; }