You are here

function block_access_permission in Block Access 7

File

./block_access.module, line 108

Code

function block_access_permission() {

  // All the "All blocks" level permissions
  $access = array(
    BLOCK_ACCESS_ADMIN => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ADMIN)),
      'restrict access' => TRUE,
    ),
    BLOCK_ACCESS_BLOCK_ADMIN => array(
      'title' => t(ucfirst(BLOCK_ACCESS_BLOCK_ADMIN)),
      'description' => t('Allow access to the block administration page. This does not stop users from configuring individual blocks (for example through the "Configure block" contextual link).'),
    ),
    BLOCK_ACCESS_CREATE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_CREATE)),
    ),
    BLOCK_ACCESS_ALL_VIEW => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_VIEW)),
    ),
    BLOCK_ACCESS_ALL_MOVE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_MOVE)),
    ),
    BLOCK_ACCESS_ALL_ENABLE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_ENABLE)),
    ),
    BLOCK_ACCESS_ALL_DISABLE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_DISABLE)),
    ),
    BLOCK_ACCESS_ALL_DELETE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_DELETE)),
    ),
    BLOCK_ACCESS_ALL_CONFIG => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_LANG => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_LANG)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_TITLE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_TITLE)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_DESC => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_DESC)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_BODY => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_BODY)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_REGION => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_REGION)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_VISIBILITY => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_VISIBILITY)),
      'description' => t('This must be checked for the individual visibility permissions to work. It will also override any individual visibility settings if not checked.'),
    ),
    BLOCK_ACCESS_ALL_CONFIG_USER => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_USER)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_ROLE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_ROLE)),
    ),
    BLOCK_ACCESS_ALL_CONFIG_PAGE => array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_PAGE)),
    ),
  );

  // The content type visibility settings only gets added if the node module is enabled.
  // I'm not sure who uses drupal without node enabled but it's possible...
  if (module_exists('node')) {
    $access[BLOCK_ACCESS_ALL_CONFIG_TYPE] = array(
      'title' => t(ucfirst(BLOCK_ACCESS_ALL_CONFIG_TYPE)),
    );
  }
  return $access;
}