You are here

function internal_nodes_permission in Internal Nodes 7

Implements hook_permission().

File

./internal_nodes.module, line 55
Internal nodes

Code

function internal_nodes_permission() {

  // Add the admin perm.
  $perms = array(
    'administer internal nodes' => array(
      'title' => t('Administer Internal nodes'),
      'description' => t('Perform administration tasks for Internal nodes.'),
    ),
    'blocked node status' => array(
      'title' => t('Blocked node status'),
      'description' => t('View status messages for blocked nodes.'),
    ),
  );

  // Add perms for each content type
  $types = node_type_get_types();
  $names = node_type_get_names();
  foreach ($names as $key => $name) {
    $type = $types[$key];
    $url = 'admin/structure/types/manage/' . str_replace('_', '-', $key);
    $options['fragment'] = 'edit-internal-nodes';
    $perms['access ' . $key . ' node view'] = array(
      'title' => t('Access !name node view', array(
        '!name' => l($name, $url, $options),
      )),
    );
  }
  return $perms;
}