function menu_check_user_access
Search API
7.x menu.inc | menu_check_user_access($router_item) |
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.
8 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_breadcrumbs in includes/
theme.inc - Return the HTML for breadcrumbs for the current page we are on. Will skip any breadcrumbs we do not have permission to access.
- fp_render_menu_item in includes/
theme.inc
File
- includes/
menu.inc, line 92
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";
}
}
// Does the access_arguments have any wildcards?
if (isset($router_item ['access_arguments']) && is_array($router_item ['access_arguments'])) {
if (count($router_item ['access_arguments']) == 1 && !$router_item ['access_arguments'][0]) {
// Meanng, access arguments has been created, but nothing there. We likely need to populate it if there are wildcards in this item.
$router_item = menu_get_item($router_item ['path']);
}
}
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;
}