fix: name coherence + test logic
All checks were successful
Format / formatting (push) Successful in 6s
Build / build (push) Successful in 43s
CI / build (push) Successful in 13s

This commit is contained in:
Pierre Tellier
2025-04-06 20:30:29 +02:00
parent 9e1f568ea4
commit b672dd200c
3 changed files with 40 additions and 19 deletions

View File

@ -46,6 +46,14 @@ public class UtilsService {
}
User user = this.userService.getUserByEmail(mail);
Entrepreneur entrepreneur = this.entrepreneurService.getEntrepreneurById(user.getIdUser());
if (entrepreneur == null) {
logger.debug("testing access with an unknown Entrepreneur");
return false;
}
if (entrepreneur.getProjectParticipation() == null) {
logger.debug("testing access with an user with no project participation");
return false;
}
Project project = this.projectService.getProjectById(projectId);
// We compare the ID instead of the project themselves
return Objects.equals(

View File

@ -106,9 +106,8 @@ public class SectionCellService {
return this.sectionCellRepository.save(sectionCell.get());
}
public Iterable<SectionCell> getSectionCellsByProject(Project project, Long idSectionCell) {
return this.sectionCellRepository.findByProjectSectionCellAndSectionId(
project, idSectionCell);
public Iterable<SectionCell> getSectionCellsByProject(Project project, Long sectionId) {
return this.sectionCellRepository.findByProjectSectionCellAndSectionId(project, sectionId);
}
public Long getProjectId(Long sectionCellId) {