function drupal_access_denied

You are here

7 drupal_access_denied()
4.6 drupal_access_denied()
4.7 drupal_access_denied()
5 drupal_access_denied()
6 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

7 calls to drupal_access_denied()
book_export_html in modules/book/
Generates HTML for export when invoked by book_export().
contact_personal_form in modules/contact/
Form constructor for the personal contact form.
contact_site_form in modules/contact/
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/
Menu handler for private file transfers.

... See full list


includes/, line 744
Common functions that many Drupal modules will need to reference.


function drupal_access_denied() {


When calling this from THEME_preprocess_page it appears that it's necessary to add in:


Taken from this comment about the D6 version: