Same name and namespace in other branches
  1. 4.6.x includes/common.inc \drupal_access_denied()
  2. 4.7.x includes/common.inc \drupal_access_denied()
  3. 5.x includes/common.inc \drupal_access_denied()
  4. 6.x includes/common.inc \drupal_access_denied()

Delivers an "access denied" error to the browser.

Page callback functions wanting to report an "access denied" message should return MENU_ACCESS_DENIED instead of calling drupal_access_denied(). However, functions that are invoked in contexts where that return value might not bubble up to menu_execute_active_handler() should call drupal_access_denied().

Related topics

6 calls to drupal_access_denied()
contact_personal_form in modules/contact/contact.pages.inc
Form constructor for the personal contact form.
contact_site_form in modules/contact/contact.pages.inc
Form constructor for the site-wide contact form.
cron.php in ./cron.php
Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
file_download in includes/file.inc
Menu handler for private file transfers.
system_batch_page in modules/system/system.admin.inc
Default page callback for batches.

... See full list

File

includes/common.inc, line 750
Common functions that many Drupal modules will need to reference.

Code

function drupal_access_denied() {
  drupal_deliver_page(MENU_ACCESS_DENIED);
}