1 user.module user_cancel_access($account)

Menu access callback; limit access to account cancellation pages.

Limit access to users with the 'cancel account' permission or administrative users, and prevent the anonymous user from cancelling the account.


core/modules/user/user.module, line 1336
Enables the user registration and login system.


function user_cancel_access($account) {
  // Account for anonymous users, which are of class AnonymousUser.
  if ($account instanceof User) {
    /** @var User $account */
    return $account->access('delete');
  return FALSE;