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.

File

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

Code

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;
}