From 271e6964b32b9ae93b233c2118bab9fbc9886241 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 29 Aug 2024 09:34:13 +0700 Subject: [PATCH] =?UTF-8?q?recheck=20=E0=B9=80=E0=B8=A1=E0=B8=99=E0=B8=B9?= =?UTF-8?q?=20=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=20=E0=B8=81=E0=B8=97=E0=B8=A1.=20?= =?UTF-8?q?=E0=B8=AA=E0=B8=B2=E0=B8=A1=E0=B8=B1=E0=B8=8D=20(list=20to=20ge?= =?UTF-8?q?t)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileAbilityController.ts | 2 +- src/controllers/ProfileAssessmentsController.ts | 2 +- src/controllers/ProfileCertificateController.ts | 2 +- src/controllers/ProfileChangeNameController.ts | 2 +- src/controllers/ProfileChildrenController.ts | 2 +- src/controllers/ProfileController.ts | 10 +++++----- src/controllers/ProfileDisciplineController.ts | 2 +- src/controllers/ProfileDutyController.ts | 2 +- src/controllers/ProfileEducationsController.ts | 2 +- src/controllers/ProfileFamilyMotherController.ts | 2 +- src/controllers/ProfileHonorController.ts | 2 +- src/controllers/ProfileInsigniaController.ts | 2 +- src/controllers/ProfileLeaveController.ts | 2 +- src/controllers/ProfileNopaidController.ts | 2 +- src/controllers/ProfileOtherController.ts | 2 +- src/controllers/ProfileSalaryController.ts | 8 ++++---- src/controllers/ProfileTrainingController.ts | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/controllers/ProfileAbilityController.ts b/src/controllers/ProfileAbilityController.ts index 66a9bb24..7610f058 100644 --- a/src/controllers/ProfileAbilityController.ts +++ b/src/controllers/ProfileAbilityController.ts @@ -127,7 +127,7 @@ export class ProfileAbilityController extends Controller { where: { id: abilityId }, }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.profileAbilityHistoryRepo.find({ relations: ["histories"], diff --git a/src/controllers/ProfileAssessmentsController.ts b/src/controllers/ProfileAssessmentsController.ts index 587ede10..316b76eb 100644 --- a/src/controllers/ProfileAssessmentsController.ts +++ b/src/controllers/ProfileAssessmentsController.ts @@ -150,7 +150,7 @@ export class ProfileAssessmentsController extends Controller { }, }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } return new HttpSuccess(record); } diff --git a/src/controllers/ProfileCertificateController.ts b/src/controllers/ProfileCertificateController.ts index 75f00e71..76499740 100644 --- a/src/controllers/ProfileCertificateController.ts +++ b/src/controllers/ProfileCertificateController.ts @@ -113,7 +113,7 @@ export class ProfileCertificateController extends Controller { public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) { const _record = await this.certificateRepo.findOneBy({ id: certificateId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.certificateHistoryRepo.findBy({ profileCertificateId: certificateId, diff --git a/src/controllers/ProfileChangeNameController.ts b/src/controllers/ProfileChangeNameController.ts index 138c3541..51521570 100644 --- a/src/controllers/ProfileChangeNameController.ts +++ b/src/controllers/ProfileChangeNameController.ts @@ -101,7 +101,7 @@ export class ProfileChangeNameController extends Controller { public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) { const _record = await this.changeNameRepository.findOneBy({ id: changeNameId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.changeNameHistoryRepository.find({ where: { profileChangeNameId: changeNameId }, diff --git a/src/controllers/ProfileChildrenController.ts b/src/controllers/ProfileChildrenController.ts index f3833bc6..51bf8689 100644 --- a/src/controllers/ProfileChildrenController.ts +++ b/src/controllers/ProfileChildrenController.ts @@ -59,7 +59,7 @@ export class ProfileChildrenController extends Controller { public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) { const _record = await this.childrenRepository.findOneBy({ id: childrenId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.childrenHistoryRepository.find({ where: { profileChildrenId: childrenId }, diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 46619129..8ed4fd13 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -2518,7 +2518,7 @@ export class ProfileController extends Controller { @Get("history/{id}") async getProfileHistory(@Path() id: string, @Request() req: RequestWithUser) { - // await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน const profile = await this.profileHistoryRepo.find({ relations: { posLevel: true, @@ -3396,7 +3396,7 @@ export class ProfileController extends Controller { if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); } - // await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน + // await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน return new HttpSuccess(profile); } @@ -3416,7 +3416,7 @@ export class ProfileController extends Controller { if (!profile) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ"); } - // await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน + // await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน const orgRevisionPublish = await this.orgRevisionRepo .createQueryBuilder("orgRevision") @@ -3531,7 +3531,7 @@ export class ProfileController extends Controller { */ @Get("profileempid/position/{id}") async getProfileByProfileempid(@Request() request: RequestWithUser, @Path() id: string) { - // await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน + // await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน const profile = await this.profileEmpRepo.findOne({ where: { id: id }, relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"], @@ -4853,7 +4853,7 @@ export class ProfileController extends Controller { */ @Get("profileid/retire/{year}") async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) { - // await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน const profiles = await this.profileRepo .createQueryBuilder("profile") .leftJoinAndSelect("profile.posLevel", "posLevel") diff --git a/src/controllers/ProfileDisciplineController.ts b/src/controllers/ProfileDisciplineController.ts index 12e0ac32..c1fa0de4 100644 --- a/src/controllers/ProfileDisciplineController.ts +++ b/src/controllers/ProfileDisciplineController.ts @@ -124,7 +124,7 @@ export class ProfileDisciplineController extends Controller { public async disciplineHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) { const _record = await this.disciplineRepository.findOneBy({ id: disciplineId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.disciplineHistoryRepository.find({ where: { profileDisciplineId: disciplineId }, diff --git a/src/controllers/ProfileDutyController.ts b/src/controllers/ProfileDutyController.ts index 39383f82..08d9d406 100644 --- a/src/controllers/ProfileDutyController.ts +++ b/src/controllers/ProfileDutyController.ts @@ -111,7 +111,7 @@ export class ProfileDutyController extends Controller { public async dutyHistory(@Path() dutyId: string, @Request() req: RequestWithUser) { const _record = await this.dutyRepository.findOneBy({ id: dutyId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.dutyHistoryRepository.find({ where: { profileDutyId: dutyId }, diff --git a/src/controllers/ProfileEducationsController.ts b/src/controllers/ProfileEducationsController.ts index 1ed7a937..bf81e0fd 100644 --- a/src/controllers/ProfileEducationsController.ts +++ b/src/controllers/ProfileEducationsController.ts @@ -170,7 +170,7 @@ export class ProfileEducationsController extends Controller { public async getProfileEducationHistory(@Path() educationId: string, @Request() req: RequestWithUser) { const _record = await this.profileEducationRepo.findOneBy({ id: educationId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.profileEducationHistoryRepo.findBy({ profileEducationId: educationId, diff --git a/src/controllers/ProfileFamilyMotherController.ts b/src/controllers/ProfileFamilyMotherController.ts index 7f1197df..47878028 100644 --- a/src/controllers/ProfileFamilyMotherController.ts +++ b/src/controllers/ProfileFamilyMotherController.ts @@ -166,7 +166,7 @@ export class ProfileFamilyMotherController extends Controller { ], }) public async familyMotherHistory(@Path() profileId: string, @Request() req: RequestWithUser) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId); const profile = await this.profileRepo.findOne({ where: { id: profileId }, }); diff --git a/src/controllers/ProfileHonorController.ts b/src/controllers/ProfileHonorController.ts index 20ebc37c..b11ae01c 100644 --- a/src/controllers/ProfileHonorController.ts +++ b/src/controllers/ProfileHonorController.ts @@ -133,7 +133,7 @@ export class ProfileHonorController extends Controller { public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) { const _record = await this.honorRepo.findOneBy({ id: honorId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.honorHistoryRepo.findBy({ profileHonorId: honorId, diff --git a/src/controllers/ProfileInsigniaController.ts b/src/controllers/ProfileInsigniaController.ts index 9fa2de4c..e4d3dbd3 100644 --- a/src/controllers/ProfileInsigniaController.ts +++ b/src/controllers/ProfileInsigniaController.ts @@ -154,7 +154,7 @@ export class ProfileInsigniaController extends Controller { public async getInsigniaHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) { const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.insigniaHistoryRepo.find({ relations: { diff --git a/src/controllers/ProfileLeaveController.ts b/src/controllers/ProfileLeaveController.ts index 2af5f571..b54c23c3 100644 --- a/src/controllers/ProfileLeaveController.ts +++ b/src/controllers/ProfileLeaveController.ts @@ -251,7 +251,7 @@ export class ProfileLeaveController extends Controller { public async leaveHistory(@Path() leaveId: string, @Request() req: RequestWithUser) { const _record = await this.leaveRepo.findOneBy({ id: leaveId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.leaveHistoryRepo.find({ relations: { leaveType: true }, diff --git a/src/controllers/ProfileNopaidController.ts b/src/controllers/ProfileNopaidController.ts index 605dc286..3146386f 100644 --- a/src/controllers/ProfileNopaidController.ts +++ b/src/controllers/ProfileNopaidController.ts @@ -90,7 +90,7 @@ export class ProfileNopaidController extends Controller { public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) { const _record = await this.nopaidRepository.findOneBy({ id: nopaidId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); }; const record = await this.nopaidHistoryRepository.find({ where: { profileNopaidId: nopaidId }, diff --git a/src/controllers/ProfileOtherController.ts b/src/controllers/ProfileOtherController.ts index c6524d1e..a457f029 100644 --- a/src/controllers/ProfileOtherController.ts +++ b/src/controllers/ProfileOtherController.ts @@ -87,7 +87,7 @@ export class ProfileOtherController extends Controller { public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) { const _record = await this.otherRepository.findOneBy({ id: otherId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.otherHistoryRepository.find({ where: { profileOtherId: otherId }, diff --git a/src/controllers/ProfileSalaryController.ts b/src/controllers/ProfileSalaryController.ts index 0efda698..48bbdac3 100644 --- a/src/controllers/ProfileSalaryController.ts +++ b/src/controllers/ProfileSalaryController.ts @@ -145,7 +145,7 @@ export class ProfileSalaryController extends Controller { public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) { const _record = await this.salaryRepo.findOneBy({ id: salaryId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.salaryHistoryRepo.findBy({ profileSalaryId: salaryId, @@ -241,9 +241,9 @@ export class ProfileSalaryController extends Controller { @Get("swap/{direction}/{salaryId}") public async swapSalary(@Path() direction: string, salaryId: string, @Request() req: RequestWithUser) { const source_item = await this.salaryRepo.findOne({ where: { id: salaryId } }); - if (source_item) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", source_item.profileId); - } + // if (source_item) { + // await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", source_item.profileId);//ไม่แน่ใจOFFปิดไว้ก่อน + // } if (source_item == null) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); const sourceOrder = source_item.order; if (direction.trim().toUpperCase() == "UP") { diff --git a/src/controllers/ProfileTrainingController.ts b/src/controllers/ProfileTrainingController.ts index 798ec873..d460377b 100644 --- a/src/controllers/ProfileTrainingController.ts +++ b/src/controllers/ProfileTrainingController.ts @@ -134,7 +134,7 @@ export class ProfileTrainingController extends Controller { public async trainingHistory(@Path() trainingId: string, @Request() req: RequestWithUser) { const _record = await this.trainingRepo.findOneBy({ id: trainingId }); if (_record) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId); + await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId); } const record = await this.trainingHistoryRepo.findBy({ profileTrainingId: trainingId,