function user_cancel_access

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.

1 call to user_cancel_access()
LinkCancel::render_link in drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/LinkCancel.php
1 string reference to 'user_cancel_access'
user_menu in drupal/core/modules/user/user.module
Implements hook_menu().

File

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

Code

function user_cancel_access($account) {
  return ($GLOBALS['user']->uid == $account->uid && user_access('cancel account') || user_access('administer users')) && $account->uid > 0;
}