function user_cancel_access

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

modules/user/user.module, line 1627
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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.module/function/user_cancel_access/7.x