$account->
block();
} $this->
checkEditFieldAccess($account);
// Make sure that the user entity is valid (email and name are valid).
$this->
validate($account);
// Create the account.
$account->
save();
$this->
sendEmailNotifications($account);
return new ModifiedResourceResponse($account, 200
);
} /**
* Ensure the account can be registered in this request.
*
* @param \Drupal\user\UserInterface $account
* The user account to register.
*/
protected function ensureAccountCanRegister(UserInterface
$account = NULL
) {