function menu_check_user_access

6.x menu.inc menu_check_user_access($router_item)
4.x menu.inc menu_check_user_access($router_item)
5.x menu.inc menu_check_user_access($router_item)

Looks at the router item's details (from menu_get_item) and returns TRUE or FALSE if the user can access this item.

6 calls to menu_check_user_access()
fp_build_sub_tab_array in includes/theme.inc
Create a "sub-tab" array, which looks like a standard tab_array, but it contains only this page's sub-tab siblings.
fp_build_tab_array in includes/theme.inc
Looks at the current page array and returns a valid $tab_array Meant for the top of the screen.
fp_display_page in includes/theme.inc
Output the contents of the $page variable to the screen. $page is an array containing details about the page, as well as its original menu item (router_item) definition.
fp_render_menu_item in includes/theme.inc
menu_execute_page_request in includes/menu.inc

... See full list

File

includes/menu.inc, line 89

Code

function menu_check_user_access($router_item) {
  $access = FALSE;
  if ($router_item ["access_callback"] == 1) {
    $access = TRUE;
  }
  if (is_array($router_item ["access_arguments"])) {
    if ($router_item ["access_callback"] == "") {
      // If we specified access arguments, but not a callback, assume it
      // is the function user_has_permission().
      $router_item ["access_callback"] = "user_has_permission";
    }
  }

  if (!$access && $router_item ["access_callback"] != "") {
    // We need to see if the user has the right permissions to use this item.  We will do this
    // by calling the access_callback, passing it the access_arguments
    $access = call_user_func_array($router_item ["access_callback"], $router_item ["access_arguments"]);
  }


  return $access;
}