class UserManagementController extends AsyncAdaptor {

    @PreAuthorize("hasAnyAuthority('ifs_administrator', 'support')")
    @SecuredBySpring(value = "UserManagementController.viewUser() method",
            description = "IFS admins and support users can view users.")
    @GetMapping("/user/{userId}")
    public String viewUser(@PathVariable long userId) {
        return userRestService.retrieveUserById(userId).andOnSuccessReturn(user -> {
            if (UserStatus.ACTIVE.equals(user.getStatus())) {
                return redirectToActivePage(userId);
            } else {
                return redirectToInactivePage(userId);
            }
        }).getSuccess();
    }

}