class UserV1Controller implements UserV1Endpoint {

    @Override
    @CustomPermissionCheck
    @CheckPermissionByAccount(action = AuthorizationResourceAction.ENVIRONMENT_READ)
    public SyncOperationStatus setPassword(SetPasswordRequest request) {
        String userCrn = checkActorCrn();
        String accountId = ThreadBasedUserCrnProvider.getAccountId();
        LOGGER.debug("setPassword() requested for user {} in account {}", userCrn, accountId);

        Operation setPasswordOperation = passwordService.setPasswordWithCustomPermissionCheck(accountId, userCrn, userCrn,
                request.getPassword(), nullToEmpty(request.getEnvironments()), AuthorizationResourceAction.DESCRIBE_ENVIRONMENT);
        return checkOperationRejected(operationToSyncOperationStatus.convert(setPasswordOperation));
    }

}