@Test public void hasPermissionToAccessUserReturnsTrueWhenSameId() { given(userMock.getId()).willReturn(USER_ID); boolean actualHasPermission = evaluator.hasPermissionToAccessUser(authenticationMock, userMock, USER_ID); assertThat(actualHasPermission).isTrue(); }
@Override public boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId) { return user.getId().equals(userId) || hasElevatedAccessToUser(authentication, user, userId); }
UserAccessExpressionEvaluator implements ExpressionEvaluator { @Override public boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId) { return user.getId().equals(userId) || hasElevatedAccessToUser(authentication, user, userId); } }
UserAccessExpressionEvaluator implements ExpressionEvaluator { @Override public boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId) { return user.getId().equals(userId) || hasElevatedAccessToUser(authentication, user, userId); } @Autowired  UserAccessExpressionEvaluator(UserService userService,
                                         UserAccessService userAccessService,
                                         ProjectService projectService,
                                         ApplicationService applicationService,
                                         BookmarkService bookmarkService,
                                         ProjectBoardConfigurationProperties properties); }
UserAccessExpressionEvaluator implements ExpressionEvaluator { @Override public boolean hasPermissionToAccessUser(Authentication authentication, User user, String userId) { return user.getId().equals(userId) || hasElevatedAccessToUser(authentication, user, userId); } @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 hasPermissionToAccessUser(Authentication authentication, User user, String userId) { return user.getId().equals(userId) || hasElevatedAccessToUser(authentication, user, userId); } @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);  }