class UserAccessExpressionEvaluator implements ExpressionEvaluator {

    @Override
    public boolean hasAccessToProject(Authentication authentication, User user, String projectId) {
        if(projectDoesNotExistOrHasLobIndependentStatus(projectId)) {
            return true;
        }

        if(userService.userIsManager(user)) {
            return true;
        }

        var project = projectService.getProjectById(projectId);
        if(!userAccessService.userHasActiveAccessInterval(user)) {
            return applicationService.userHasAppliedForProject(user, project) ||
                    bookmarkService.userHasBookmark(user, project);
        }

        var projectLob = project.getLob();
        var userLob = userService.getUserData(user).getLob();
        var projectLobNullOrEqual = projectLob == null || projectLob.equalsIgnoreCase(userLob);

        if(projectLobNullOrEqual) {
            return true;
        }

        return applicationService.userHasAppliedForProject(user, project) ||
                bookmarkService.userHasBookmark(user, project);
    }

    @Autowired public  UserAccessExpressionEvaluator(UserService userService,
                                         UserAccessService userAccessService,
                                         ProjectService projectService,
                                         ApplicationService applicationService,
                                         BookmarkService bookmarkService,
                                         ProjectBoardConfigurationProperties properties);

}