From cea5df989d64afd43a15b98e7c36a05786a7b93c Mon Sep 17 00:00:00 2001 From: harid Date: Fri, 27 Feb 2026 18:22:40 +0700 Subject: [PATCH] fix brother --- src/interfaces/permission.ts | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/interfaces/permission.ts b/src/interfaces/permission.ts index e955f41..566c8c3 100644 --- a/src/interfaces/permission.ts +++ b/src/interfaces/permission.ts @@ -137,11 +137,26 @@ class CheckAuth { child2: node >= 3 ? [x.orgChild2Id] : null, child3: node >= 4 ? [x.orgChild3Id] : null, */ - root: minLevel <= 0 ? [x.orgRootId] : null, - child1: minLevel <= 1 ? [x.orgChild1Id] : null, - child2: minLevel <= 2 ? [x.orgChild2Id] : null, - child3: minLevel <= 3 ? [x.orgChild3Id] : null, - child4: minLevel <= 4 ? [x.orgChild4Id] : null, + root: + minLevel <= 0 && x.orgRootId + ? [x.orgRootId] + : null, + child1: + minLevel <= 1 && x.orgChild1Id + ? [x.orgChild1Id] + : null, + child2: + minLevel <= 2 && x.orgChild2Id + ? [x.orgChild2Id] + : null, + child3: + minLevel <= 3 && x.orgChild3Id + ? [x.orgChild3Id] + : null, + child4: + minLevel <= 4 && x.orgChild4Id + ? [x.orgChild4Id] + : null, privilege: "BROTHER", }; } else if (privilege == "NORMAL") {