no message
This commit is contained in:
parent
8d1d5cc45c
commit
6cfb660742
1 changed files with 31 additions and 0 deletions
|
|
@ -700,4 +700,35 @@ export class WorkflowController extends Controller {
|
||||||
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
|
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
|
||||||
return new HttpSuccess({ isOfficer: isOfficer, isStaff: !isOfficer });
|
return new HttpSuccess({ isOfficer: isOfficer, isStaff: !isOfficer });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API เช็ค สกจ
|
||||||
|
*
|
||||||
|
* @summary เช็ค สกจ
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Post("keycloak/isofficer/{system}")
|
||||||
|
async checkPermissionWorkflow(
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
@Body()
|
||||||
|
body: {
|
||||||
|
refId: string;
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
const profile = await this.profileRepo.findOne({
|
||||||
|
where: {
|
||||||
|
keycloak: req.user.sub,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งาน");
|
||||||
|
|
||||||
|
const profileOfficer = await this.workflowRepo.findOne({
|
||||||
|
where: {
|
||||||
|
states: { stateUserComments: { profile: { keycloak: req.user.sub } } },
|
||||||
|
refId: body.refId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!profileOfficer) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||||
|
return new HttpSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue