update privilage validate (NORMAL) and update calRetireLaw
This commit is contained in:
parent
897dda67ad
commit
5cdcc2a91e
4 changed files with 12 additions and 5 deletions
|
|
@ -1973,7 +1973,6 @@ export class OrganizationController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
let _privilege = await new permission().PermissionOrgList(request, "SYS_ORG");
|
||||
// console.log("privilege>>>>",_privilege);
|
||||
|
||||
const attrOwnership = _privilege.root === null ? true : false;
|
||||
|
||||
|
|
@ -1988,17 +1987,22 @@ export class OrganizationController extends Controller {
|
|||
?.find((x) => x.orgRevisionId === id)
|
||||
?.posMasterAssigns.find((x) => x.assignId === "SYS_ORG");
|
||||
|
||||
// console.log("profileAssign>>>>",profileAssign);
|
||||
|
||||
if (orgRevision.orgRevisionIsDraft && !orgRevision.orgRevisionIsCurrent && !attrOwnership) {
|
||||
_data.root = profile.permissionProfiles.map((x) => x.orgRootId);
|
||||
}
|
||||
// กำหนดการเข้าถึงข้อมูลตามสถานะและสิทธิ์
|
||||
const isCurrentActive = !orgRevision.orgRevisionIsDraft && orgRevision.orgRevisionIsCurrent;
|
||||
|
||||
if (isCurrentActive) {
|
||||
if (profileAssign && _privilege.privilege !== "OWNER") {
|
||||
_data.root = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgRootId];
|
||||
if(_privilege.privilege == "NORMAL"){
|
||||
_data.root = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgRootId];
|
||||
_data.child1 = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgChild1Id];
|
||||
_data.child2 = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgChild2Id];
|
||||
_data.child3 = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgChild3Id];
|
||||
_data.child4 = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgChild4Id];
|
||||
}else{
|
||||
_data.root = [profile.current_holders.find((x) => x.orgRevisionId === id)?.orgRootId];
|
||||
}
|
||||
} else {
|
||||
if (!attrOwnership) _data = _privilege;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue