690329:2209 Fixing refactor Correspondence GPT-5.3-Codex #04
CI / CD Pipeline / build (push) Successful in 20m35s
CI / CD Pipeline / deploy (push) Successful in 10m59s

This commit is contained in:
2026-03-29 22:09:40 +07:00
parent df3020012d
commit abbdebf2b9
21 changed files with 4426 additions and 24 deletions
@@ -631,8 +631,20 @@ export class CorrespondenceService {
const status = await this.statusRepo.findOne({
where: { id: revision.statusId },
});
if (status && status.statusCode !== 'DRAFT') {
throw new BadRequestException('Only DRAFT documents can be updated');
const permissions = await this.userService.getUserPermissions(
user.user_id
);
const canEditSubmittedOrLater =
permissions.includes('correspondence.cancel') ||
permissions.includes('system.manage_all');
if (!canEditSubmittedOrLater) {
throw new ForbiddenException(
'Only Org Admin or Superadmin can edit non-draft correspondences'
);
}
}
}