role เมนู ข้าราชการ กทม. สามัญ

This commit is contained in:
AdisakKanthawilang 2024-08-22 17:25:25 +07:00
parent edad154826
commit 4b42b896fa
22 changed files with 307 additions and 157 deletions

View file

@ -127,7 +127,8 @@ export class ProfileGovernmentHistoryController extends Controller {
*/
@Get("{profileId}")
@Example({})
public async getGovHistory(@Path() profileId: string) {
public async getGovHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
const record = await this.profileRepo.findOne({
where: { id: profileId },
relations: {
@ -243,7 +244,8 @@ export class ProfileGovernmentHistoryController extends Controller {
*/
@Get("history/{profileId}")
@Example({})
public async govHistory(@Path() profileId: string) {
public async govHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
const record = await this.govRepo.find({
order: { lastUpdatedAt: "DESC" },
where: { profileId: profileId },
@ -265,7 +267,7 @@ export class ProfileGovernmentHistoryController extends Controller {
@Body() body: UpdateProfileGovernment,
@Path() profileId: string,
) {
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profileId);
const record = await this.profileRepo.findOne({
where: { id: profileId },
});