class UserManagementController extends AsyncAdaptor {

    @PreAuthorize("hasAnyAuthority('ifs_administrator', 'support')")
    @SecuredBySpring(value = "UserManagementController.deactivateUser() method",
            description = "IFS admins and support users can deactivate users.")
    @PostMapping(value = "/user/{userId}/active", params = "deactivateUser")
    public String deactivateUser(@PathVariable long userId) {
        return userRestService.retrieveUserById(userId).andOnSuccess(user ->
                userRestService.deactivateUser(userId)
                        .andOnSuccessReturn(p -> redirectToInactivePage(userId)))
                .getSuccess();
    }

}