fix: name coherence + test logic
This commit is contained in:
@ -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(
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user