You are here

function block_access_menu_alter in Block Access 7

Same name and namespace in other branches
  1. 6.2 block_access.module \block_access_menu_alter()
  2. 6 block_access.module \block_access_menu_alter()

File

./block_access.module, line 89

Code

function block_access_menu_alter(&$items) {
  $items[BLOCK_ACCESS_BLOCK_ADMIN_PAGE]['access arguments'] = array(
    BLOCK_ACCESS_BLOCK_ADMIN,
  );
  $items[BLOCK_ACCESS_MENU_ADD]['access arguments'] = array(
    BLOCK_ACCESS_CREATE,
  );
  $items[BLOCK_ACCESS_MENU_DELETE]['access callback'] = 'block_access_check_delete';
  $items[BLOCK_ACCESS_MENU_DELETE]['access arguments'] = array(
    4,
  );

  // Not sure if it's necessary to do both paths...
  $items[BLOCK_ACCESS_MENU_CONFIG]['access callback'] = 'block_access_check_config';
  $items[BLOCK_ACCESS_MENU_CONFIG]['access arguments'] = array(
    4,
    5,
  );
  $items[BLOCK_ACCESS_MENU_MANAGE]['access callback'] = 'block_access_check_config';
  $items[BLOCK_ACCESS_MENU_MANAGE]['access arguments'] = array(
    4,
    5,
  );
}