@Test public void hasAccessToProjectsReturnsTrueWhenUserIsNoManagerButAccessIsActive() { given(userAccessServiceMock.userHasActiveAccessInterval(userMock)).willReturn(true); boolean actualHasAccess = evaluator.hasAccessToProjects(authenticationMock, userMock); assertThat(actualHasAccess).isTrue(); }
@Override public boolean hasAccessToProjects(Authentication authentication, User user) { return userAccessService.userHasActiveAccessInterval(user) || userService.userIsManager(user); }
UserAccessExpressionEvaluator implements ExpressionEvaluator { @Override public boolean hasAccessToProjects(Authentication authentication, User user) { return userAccessService.userHasActiveAccessInterval(user) || userService.userIsManager(user); } }
UserAccessExpressionEvaluator implements ExpressionEvaluator { @Override public boolean hasAccessToProjects(Authentication authentication, User user) { return userAccessService.userHasActiveAccessInterval(user) || userService.userIsManager(user); } @Autowired  UserAccessExpressionEvaluator(UserService userService,
                                         UserAccessService userAccessService,
                                         ProjectService projectService,
                                         ApplicationService applicationService,
                                         BookmarkService bookmarkService,
                                         ProjectBoardConfigurationProperties properties); }
UserAccessExpressionEvaluator implements ExpressionEvaluator { @Override public boolean hasAccessToProjects(Authentication authentication, User user) { return userAccessService.userHasActiveAccessInterval(user) || userService.userIsManager(user); } @Autowired  UserAccessExpressionEvaluator(UserService userService,
                                         UserAccessService userAccessService,
                                         ProjectService projectService,
                                         ApplicationService applicationService,
                                         BookmarkService bookmarkService,
                                         ProjectBoardConfigurationProperties properties); @Override boolean hasAccessToProjects(Authentication authentication, User user); @Override boolean hasAccessToProject(Authentication authentication, User user, String projectId); @Override boolean hasPermissionToApplyToProject(Authentication authentication, User user, String projectId); @Override boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId); @Override boolean hasElevatedAccessToUser(Authentication authentication, User user, String userId); }
UserAccessExpressionEvaluator implements ExpressionEvaluator { @Override public boolean hasAccessToProjects(Authentication authentication, User user) { return userAccessService.userHasActiveAccessInterval(user) || userService.userIsManager(user); } @Autowired  UserAccessExpressionEvaluator(UserService userService,
                                         UserAccessService userAccessService,
                                         ProjectService projectService,
                                         ApplicationService applicationService,
                                         BookmarkService bookmarkService,
                                         ProjectBoardConfigurationProperties properties); @Override boolean hasAccessToProjects(Authentication authentication, User user); @Override boolean hasAccessToProject(Authentication authentication, User user, String projectId); @Override boolean hasPermissionToApplyToProject(Authentication authentication, User user, String projectId); @Override boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId); @Override boolean hasElevatedAccessToUser(Authentication authentication, User user, String userId);  }