@Test void getAllMolgenisUsersNonSu() { this.setSecurityContextNonSuperUserWrite(); assertThrows(AccessDeniedException.class, () -> this.userManagerService.getAllUsers()); }
@Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional(readOnly = true) public List<UserViewData> getAllUsers() { Stream<User> users = dataService.findAll(USER, User.class); return this.parseToMolgenisUserViewData(users); }
UserManagerServiceImpl implements UserManagerService { @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional(readOnly = true) public List<UserViewData> getAllUsers() { Stream<User> users = dataService.findAll(USER, User.class); return this.parseToMolgenisUserViewData(users); } }
UserManagerServiceImpl implements UserManagerService { @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional(readOnly = true) public List<UserViewData> getAllUsers() { Stream<User> users = dataService.findAll(USER, User.class); return this.parseToMolgenisUserViewData(users); } UserManagerServiceImpl(DataService dataService); }
UserManagerServiceImpl implements UserManagerService { @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional(readOnly = true) public List<UserViewData> getAllUsers() { Stream<User> users = dataService.findAll(USER, User.class); return this.parseToMolgenisUserViewData(users); } UserManagerServiceImpl(DataService dataService); @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional(readOnly = true) List<UserViewData> getAllUsers(); @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional void setActivationUser(String userId, Boolean active); }
UserManagerServiceImpl implements UserManagerService { @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional(readOnly = true) public List<UserViewData> getAllUsers() { Stream<User> users = dataService.findAll(USER, User.class); return this.parseToMolgenisUserViewData(users); } UserManagerServiceImpl(DataService dataService); @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional(readOnly = true) List<UserViewData> getAllUsers(); @Override @PreAuthorize("hasAnyRole('ROLE_SU','ROLE_MANAGER')") @Transactional void setActivationUser(String userId, Boolean active);  }