You are here

function ack_menu_menu_access in Access Control Kit 7

Access callback for managing a menu.

Parameters

array $menu: An array defining a menu.

object $account: (optional) A user account. Defaults to the currently logged-in user.

Return value

bool TRUE if the user account has access to manage the menu.

3 calls to ack_menu_menu_access()
ack_menu_admin_page in ack_menu/ack_menu.pages.inc
Menu page callback which shows an overview of all accessible menus.
ack_menu_form_node_form_alter in ack_menu/ack_menu.module
Implements hook_form_BASE_FORM_ID_alter().
ack_menu_link_access in ack_menu/ack_menu.module
Access callback for editing or deleting a menu link.
1 string reference to 'ack_menu_menu_access'
ack_menu_menu_alter in ack_menu/ack_menu.module
Implements hook_menu_alter().

File

ack_menu/ack_menu.module, line 211
The ACK menu module.

Code

function ack_menu_menu_access($menu, $account = NULL) {

  // Global menu administrators have access to all menus.
  if (user_access('administer menu', $account)) {
    return TRUE;
  }

  // Scheme menu administrators have access to menus managed by ACK.
  if (user_access('administer ack_menu', $account)) {
    $menu_name = $menu['menu_name'];
    $managed = _ack_menu_managed_menus();
    return isset($managed[$menu_name]);
  }
  return FALSE;
}