Merge pull request #375 from Kitzanos/company-document-prod

Cherry-pick (Enabled permission for accessing company documents)
This commit is contained in:
Antonio Manca
2025-11-20 10:50:19 +01:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -314,7 +314,9 @@ public class CompanyDocumentDao {
public List<CompanyDocumentResponseBean> getAllCompanyDocument(UserEntity user , Long companyId, CompanyDocumentTypeEnum typeEnum){
log.info("Fetching all company documents for Company ID '{}', User ID '{}', Type '{}'", companyId, user.getId(), typeEnum);
if(Boolean.TRUE.equals(validator.checkIsBeneficiary())) {
validator.validateUserWithCompany(request, companyId);
}
companyService.validateCompany(companyId);
Specification<CompanyDocumentEntity> spec = filterCompanyDocuments(companyId, user.getId(), typeEnum);

View File

@@ -92,6 +92,8 @@ public class Validator {
return companyEntity;
} else if (checkIsInstructorManager()) {
return companyEntity;
}else if (checkIsPreInstructor()) {
return companyEntity;
}
Map<String, Object> userInfo = tokenProvider.getUserInfoAndUserIdFromToken(request);
companyService.validateUserWithCompny(getUserId(userInfo), companyId);