fix privilage parent

This commit is contained in:
Adisak 2026-02-20 17:34:16 +07:00
parent c42a4c3a12
commit 2231ce6b7c

View file

@ -295,7 +295,7 @@ export class KpiUserEvaluationController extends Controller {
params,
};
}
}
}
else if (_data.privilege === "BROTHER") {
const parentLevel = level !== null ? level - 1 : null;
if (parentLevel != null && parentLevel === 0 && orgDna.rootDnaId) {
@ -324,7 +324,7 @@ export class KpiUserEvaluationController extends Controller {
params,
};
}
}
}
// else if (_data.privilege === "PARENT") {
// if (level === 0) {
// if (orgDna.rootDnaId) {
@ -601,7 +601,6 @@ export class KpiUserEvaluationController extends Controller {
let nodeId = resolveNodeId(orgDna);
let conditions: string[] = [];
let params: any = {};
if (_data.privilege === "CHILD" || /*_data.privilege === "PARENT" ||*/ _data.privilege === "BROTHER") {
if (_data.privilege === "CHILD") {
@ -636,7 +635,7 @@ export class KpiUserEvaluationController extends Controller {
params,
};
}
}
}
else if (_data.privilege === "BROTHER") {
const parentLevel = level !== null ? level - 1 : null;
if (parentLevel != null && parentLevel === 0 && orgDna.rootDnaId) {
@ -665,7 +664,7 @@ export class KpiUserEvaluationController extends Controller {
params,
};
}
}
}
// else if (_data.privilege === "PARENT") {
// if (level === 0) {
// if (orgDna.rootDnaId) {
@ -695,7 +694,7 @@ export class KpiUserEvaluationController extends Controller {
// };
// }
// }
} else if (_data.privilege === "OWNER" || _data.privilege === "ROOT" || _data.privilege === "PARENT") {
} else if (_data.privilege === "ROOT") {
if (orgDna.rootDnaId) {
conditions.push("kpiUserEvaluation.orgDnaId = :root");
params.root = orgDna.rootDnaId;