Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m0s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m0s
This commit is contained in:
commit
be70a5abc9
2 changed files with 37 additions and 33 deletions
|
|
@ -161,7 +161,7 @@ export class EvaluationController {
|
||||||
let nodeId = resolveNodeId(orgDna);
|
let nodeId = resolveNodeId(orgDna);
|
||||||
let conditions: string[] = [];
|
let conditions: string[] = [];
|
||||||
let params: any = {};
|
let params: any = {};
|
||||||
if (_data.privilege === "CHILD" || _data.privilege === "PARENT" || _data.privilege === "BROTHER") {
|
if (_data.privilege === "CHILD" || /*_data.privilege === "PARENT" ||*/ _data.privilege === "BROTHER") {
|
||||||
if (_data.privilege === "CHILD") {
|
if (_data.privilege === "CHILD") {
|
||||||
|
|
||||||
if (level === 0 && orgDna.rootDnaId) {
|
if (level === 0 && orgDna.rootDnaId) {
|
||||||
|
|
@ -195,7 +195,8 @@ export class EvaluationController {
|
||||||
params,
|
params,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else if (_data.privilege === "BROTHER") {
|
}
|
||||||
|
else if (_data.privilege === "BROTHER") {
|
||||||
const parentLevel = level !== null ? level - 1 : null;
|
const parentLevel = level !== null ? level - 1 : null;
|
||||||
if (parentLevel != null && parentLevel === 0 && orgDna.rootDnaId) {
|
if (parentLevel != null && parentLevel === 0 && orgDna.rootDnaId) {
|
||||||
conditions.push("evaluation.rootDnaId = :root");
|
conditions.push("evaluation.rootDnaId = :root");
|
||||||
|
|
@ -217,34 +218,6 @@ export class EvaluationController {
|
||||||
params.child3 = orgDna.child3DnaId;
|
params.child3 = orgDna.child3DnaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conditions.length > 0) {
|
|
||||||
typeCondition = {
|
|
||||||
query: conditions.join(" AND "),
|
|
||||||
params,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else if (_data.privilege === "PARENT") {
|
|
||||||
if (level === 0) {
|
|
||||||
if (orgDna.rootDnaId) {
|
|
||||||
conditions.push("evaluation.rootDnaId = :root");
|
|
||||||
params.root = orgDna.rootDnaId;
|
|
||||||
}
|
|
||||||
} else if (level === 1) {
|
|
||||||
if (orgDna.rootDnaId) {
|
|
||||||
conditions.push("evaluation.rootDnaId = :root AND evaluation.child1DnaId IS NOT NULL");
|
|
||||||
params.root = orgDna.rootDnaId;
|
|
||||||
}
|
|
||||||
} else if (level === 2) {
|
|
||||||
conditions.push("evaluation.child1DnaId = :child1 AND evaluation.child2DnaId IS NOT NULL");
|
|
||||||
params.child1 = orgDna.child1DnaId;
|
|
||||||
} else if (level === 3) {
|
|
||||||
conditions.push("evaluation.child2DnaId = :child2 AND evaluation.child3DnaId IS NOT NULL");
|
|
||||||
params.child2 = orgDna.child2DnaId;
|
|
||||||
} else if (level === 4) {
|
|
||||||
conditions.push("evaluation.child3DnaId = :child3 AND evaluation.child4DnaId IS NOT NULL");
|
|
||||||
params.child3 = orgDna.child3DnaId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (conditions.length > 0) {
|
if (conditions.length > 0) {
|
||||||
typeCondition = {
|
typeCondition = {
|
||||||
query: conditions.join(" AND "),
|
query: conditions.join(" AND "),
|
||||||
|
|
@ -252,7 +225,36 @@ export class EvaluationController {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (_data.privilege === "OWNER" || _data.privilege === "ROOT") {
|
// else if (_data.privilege === "PARENT") {
|
||||||
|
// if (level === 0) {
|
||||||
|
// if (orgDna.rootDnaId) {
|
||||||
|
// conditions.push("evaluation.rootDnaId = :root");
|
||||||
|
// params.root = orgDna.rootDnaId;
|
||||||
|
// }
|
||||||
|
// } else if (level === 1) {
|
||||||
|
// if (orgDna.rootDnaId) {
|
||||||
|
// conditions.push("evaluation.rootDnaId = :root AND evaluation.child1DnaId IS NOT NULL");
|
||||||
|
// params.root = orgDna.rootDnaId;
|
||||||
|
// }
|
||||||
|
// } else if (level === 2) {
|
||||||
|
// conditions.push("evaluation.child1DnaId = :child1 AND evaluation.child2DnaId IS NOT NULL");
|
||||||
|
// params.child1 = orgDna.child1DnaId;
|
||||||
|
// } else if (level === 3) {
|
||||||
|
// conditions.push("evaluation.child2DnaId = :child2 AND evaluation.child3DnaId IS NOT NULL");
|
||||||
|
// params.child2 = orgDna.child2DnaId;
|
||||||
|
// } else if (level === 4) {
|
||||||
|
// conditions.push("evaluation.child3DnaId = :child3 AND evaluation.child4DnaId IS NOT NULL");
|
||||||
|
// params.child3 = orgDna.child3DnaId;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (conditions.length > 0) {
|
||||||
|
// typeCondition = {
|
||||||
|
// query: conditions.join(" AND "),
|
||||||
|
// params,
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
} else if (_data.privilege === "OWNER" || _data.privilege === "ROOT" || _data.privilege === "PARENT") {
|
||||||
if (orgDna.rootDnaId) {
|
if (orgDna.rootDnaId) {
|
||||||
conditions.push("evaluation.rootDnaId = :root");
|
conditions.push("evaluation.rootDnaId = :root");
|
||||||
params.root = orgDna.rootDnaId;
|
params.root = orgDna.rootDnaId;
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,10 @@ class CheckAuth {
|
||||||
};
|
};
|
||||||
} else if (privilege == "PARENT") {
|
} else if (privilege == "PARENT") {
|
||||||
data = {
|
data = {
|
||||||
root: [x.orgRootId],
|
// root: [x.orgRootId],
|
||||||
child1: [null],
|
// child1: [null],
|
||||||
|
root: null,
|
||||||
|
child1: null,
|
||||||
child2: null,
|
child2: null,
|
||||||
child3: null,
|
child3: null,
|
||||||
child4: null,
|
child4: null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue