fix ระบบแจ้ง Noti สิทธิ์ BROTHER
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m7s

This commit is contained in:
harid 2026-05-15 11:12:17 +07:00
parent 3c8b377764
commit 9f2fec3ee3

View file

@ -8863,7 +8863,6 @@ export class OrganizationDotnetController extends Controller {
// Staff ต้องอยู่บนกว่าหรือเท่ากับ User // Staff ต้องอยู่บนกว่าหรือเท่ากับ User
if (staffNode > userNode) return false; if (staffNode > userNode) return false;
// เช็ค DNA ตรงกันที่ระดับ Staff
switch (staffNode) { switch (staffNode) {
case 0: case 0:
if (staffDna.root !== userDna.root) return false; if (staffDna.root !== userDna.root) return false;
@ -8896,10 +8895,8 @@ export class OrganizationDotnetController extends Controller {
// BROTHER: Staff เห็น User ที่อยู่ในกิ่งข้างบนและลูก // BROTHER: Staff เห็น User ที่อยู่ในกิ่งข้างบนและลูก
if (privilege === "BROTHER") { if (privilege === "BROTHER") {
// User ต้องอยู่ในช่วง [Staff Node - 1, 4]
if (userNode < staffNode - 1 || userNode > 4) return false; if (userNode < staffNode - 1 || userNode > 4) return false;
// เช็ค DNA ตรงกันตามระดับของ Staff
if (staffNode === 0) { if (staffNode === 0) {
if (staffDna.root !== userDna.root) return false; if (staffDna.root !== userDna.root) return false;
} else if (staffNode === 1) { } else if (staffNode === 1) {
@ -8907,14 +8904,13 @@ export class OrganizationDotnetController extends Controller {
if (staffDna.child1 !== userDna.child1) return false; if (staffDna.child1 !== userDna.child1) return false;
} else if (staffNode === 2) { } else if (staffNode === 2) {
if (staffDna.child1 !== userDna.child1) return false; if (staffDna.child1 !== userDna.child1) return false;
if (staffDna.child2 !== userDna.child2) return false; if (staffDna.child2 !== userDna.child2 && userDna.child2 !== null) return false;
if (staffDna.child3 !== userDna.child3) return false;
} else if (staffNode === 3) { } else if (staffNode === 3) {
if (staffDna.child2 !== userDna.child2) return false; 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) { } else if (staffNode === 4) {
if (staffDna.child3 !== userDna.child3) return false; 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; return true;
} }