role เมนู ลูกจ้างประจำ กทม.

This commit is contained in:
AdisakKanthawilang 2024-08-23 16:28:31 +07:00
parent 359d22beec
commit 7237c68cb8
23 changed files with 327 additions and 155 deletions

View file

@ -134,7 +134,8 @@ export class ProfileGovernmentEmployeeController extends Controller {
*/
@Get("{profileEmployeeId}")
@Example({})
public async getGovHistory(@Path() profileEmployeeId: string) {
public async getGovHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const record = await this.profileEmployeeRepo.findOne({
where: { id: profileEmployeeId },
relations: {
@ -240,7 +241,8 @@ export class ProfileGovernmentEmployeeController extends Controller {
*/
@Get("history/{profileEmployeeId}")
@Example({})
public async govHistory(@Path() profileEmployeeId: string) {
public async govHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId)
const record = await this.govRepo.find({
order: { lastUpdatedAt: "DESC" },
where: { profileEmployeeId: profileEmployeeId },
@ -259,7 +261,7 @@ export class ProfileGovernmentEmployeeController extends Controller {
@Body() body: UpdateProfileGovernment,
@Path() profileEmployeeId: string,
) {
await new permission().PermissionUpdate(req, "SYS_REGISTRY_EMP");
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_EMP", profileEmployeeId)
const record = await this.profileEmployeeRepo.findOne({
where: { id: profileEmployeeId },
});