This commit is contained in:
harid 2026-03-02 12:01:17 +07:00
parent cea5df989d
commit bb3ed504c0

View file

@ -128,7 +128,6 @@ class CheckAuth {
privilege: "CHILD", privilege: "CHILD",
}; };
} else if (privilege == "BROTHER") { } else if (privilege == "BROTHER") {
const minLevel = node === 0 ? 0 : node - 1;
data = { data = {
// root: node >= 0 ? [x.orgRootId] : null, // root: node >= 0 ? [x.orgRootId] : null,
/* /*
@ -137,35 +136,20 @@ class CheckAuth {
child2: node >= 3 ? [x.orgChild2Id] : null, child2: node >= 3 ? [x.orgChild2Id] : null,
child3: node >= 4 ? [x.orgChild3Id] : null, child3: node >= 4 ? [x.orgChild3Id] : null,
*/ */
root: root: (node == 0 || node == 1) ? [x.orgRootId] : null,
minLevel <= 0 && x.orgRootId child1: node == 2 ? [x.orgChild1Id] : null,
? [x.orgRootId] child2: node == 3 ? [x.orgChild2Id] : null,
: null, child3: node == 4 ? [x.orgChild3Id] : null,
child1: child4: node == 4 ? [x.orgChild4Id] : null,
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", privilege: "BROTHER",
}; };
} else if (privilege == "NORMAL") { } else if (privilege == "NORMAL") {
data = { data = {
root: node == 0 ? [x.orgRootId] : null, root: x.orgRootId != null ? [x.orgRootId] : [],
child1: node == 1 ? [x.orgChild1Id] : null, child1: x.orgChild1Id != null ? [x.orgChild1Id] : [],
child2: node == 2 ? [x.orgChild2Id] : null, child2: x.orgChild2Id != null ? [x.orgChild2Id] : [],
child3: node == 3 ? [x.orgChild3Id] : null, child3: x.orgChild3Id != null ? [x.orgChild3Id] : [],
child4: node == 4 ? [x.orgChild4Id] : null, child4: x.orgChild4Id != null ? [x.orgChild4Id] : [],
privilege: "NORMAL", privilege: "NORMAL",
}; };
} else if (privilege == "SPECIFIC") { } else if (privilege == "SPECIFIC") {