แก้ สิทธิ์
This commit is contained in:
parent
98a1d2d4dc
commit
19ffc8f084
1 changed files with 30 additions and 5 deletions
|
|
@ -922,13 +922,24 @@ export class WorkflowController extends Controller {
|
|||
},
|
||||
relations: ["orgChild1"],
|
||||
});
|
||||
const profileDirector = await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
current_holderId: profile.id,
|
||||
},
|
||||
select: ["isDirector"],
|
||||
});
|
||||
if (!profileOfficer)
|
||||
return new HttpSuccess({ isOfficer: false, isStaff: false, isDirector: false });
|
||||
return new HttpSuccess({
|
||||
isOfficer: false,
|
||||
isStaff: false,
|
||||
isDirector: profileDirector?.isDirector ?? false,
|
||||
});
|
||||
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
|
||||
return new HttpSuccess({
|
||||
isOfficer: isOfficer,
|
||||
isStaff: !isOfficer,
|
||||
isDirector: profileOfficer.isDirector,
|
||||
isDirector: profileDirector?.isDirector ?? false,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -955,14 +966,28 @@ export class WorkflowController extends Controller {
|
|||
},
|
||||
relations: ["orgChild1"],
|
||||
});
|
||||
const profileDirector = await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
current_holderId: profile.id,
|
||||
},
|
||||
select: ["isDirector"],
|
||||
});
|
||||
if (!profileOfficer)
|
||||
return new HttpSuccess({ isOfficer: false, isStaff: false, isDirector: false });
|
||||
return new HttpSuccess({
|
||||
isOfficer: false,
|
||||
isStaff: false,
|
||||
isDirector: profileDirector?.isDirector ?? false,
|
||||
});
|
||||
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
|
||||
return new HttpSuccess({
|
||||
isOfficer: isOfficer,
|
||||
isStaff: !isOfficer,
|
||||
isDirector:
|
||||
!profileOfficer.orgChild1Id && profileOfficer.orgRootId ? profileOfficer.isDirector : false,
|
||||
isDirector: profileDirector
|
||||
? !profileDirector.orgChild1Id && profileDirector.orgRootId
|
||||
? profileDirector.isDirector
|
||||
: false
|
||||
: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue