fix ระบบแจ้ง Noti สิทธิ์ BROTHER
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m7s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m7s
This commit is contained in:
parent
3c8b377764
commit
9f2fec3ee3
1 changed files with 3 additions and 7 deletions
|
|
@ -8863,7 +8863,6 @@ export class OrganizationDotnetController extends Controller {
|
|||
// Staff ต้องอยู่บนกว่าหรือเท่ากับ User
|
||||
if (staffNode > userNode) return false;
|
||||
|
||||
// เช็ค DNA ตรงกันที่ระดับ Staff
|
||||
switch (staffNode) {
|
||||
case 0:
|
||||
if (staffDna.root !== userDna.root) return false;
|
||||
|
|
@ -8896,10 +8895,8 @@ export class OrganizationDotnetController extends Controller {
|
|||
|
||||
// BROTHER: Staff เห็น User ที่อยู่ในกิ่งข้างบนและลูก
|
||||
if (privilege === "BROTHER") {
|
||||
// User ต้องอยู่ในช่วง [Staff Node - 1, 4]
|
||||
if (userNode < staffNode - 1 || userNode > 4) return false;
|
||||
|
||||
// เช็ค DNA ตรงกันตามระดับของ Staff
|
||||
if (staffNode === 0) {
|
||||
if (staffDna.root !== userDna.root) return false;
|
||||
} else if (staffNode === 1) {
|
||||
|
|
@ -8907,14 +8904,13 @@ export class OrganizationDotnetController extends Controller {
|
|||
if (staffDna.child1 !== userDna.child1) return false;
|
||||
} else if (staffNode === 2) {
|
||||
if (staffDna.child1 !== userDna.child1) return false;
|
||||
if (staffDna.child2 !== userDna.child2) return false;
|
||||
if (staffDna.child3 !== userDna.child3) return false;
|
||||
if (staffDna.child2 !== userDna.child2 && userDna.child2 !== null) return false;
|
||||
} else if (staffNode === 3) {
|
||||
if (staffDna.child2 !== userDna.child2) return false;
|
||||
if (staffDna.child3 !== userDna.child3) return false;
|
||||
if (staffDna.child3 !== userDna.child3 && userDna.child3 !== null) return false;
|
||||
} else if (staffNode === 4) {
|
||||
if (staffDna.child3 !== userDna.child3) return false;
|
||||
if (staffDna.child4 !== userDna.child4) return false;
|
||||
if (staffDna.child4 !== userDna.child4 && userDna.child4 !== null) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue