You are here

function protected_node_permission in Protected Node 7

Same name and namespace in other branches
  1. 1.0.x protected_node.module \protected_node_permission()

Implements hook_permission().

File

./protected_node.module, line 83
Protected Node module.

Code

function protected_node_permission() {
  $permissions = array(
    'access protected node overview page' => array(
      'title' => t('Access protected node overview page'),
    ),
    'access protected node password form' => array(
      'title' => t('Access protected node password form'),
      'description' => t('Access protected node password form page. Without this permission user will be denied access completely.'),
    ),
    'edit any protected node password' => array(
      'title' => t('Edit any protected node password'),
      'description' => t('Edit the password of any protected node. Grants access to the password fieldset in the node form.'),
    ),
    'view protected content' => array(
      'title' => t('View protected content (bypass password)'),
      'description' => t('Allow to view any protected node by bypassing the password protection.'),
    ),
    'edit protected content' => array(
      'title' => t('Edit protected content (bypass password)'),
      'description' => t('Allow to edit any protected node by bypassing the password protection. Do not allow to edit the password. Note: the user will also be able to view the content without entering the password.'),
    ),
  );
  foreach (node_type_get_types() as $key => $type) {
    $permissions['edit ' . $key . ' password'] = array(
      'title' => t('Edit %type_name password', array(
        '%type_name' => $key,
      )),
      'description' => t('Edit password for %type_name nodes', array(
        '%type_name' => $key,
      )),
    );
  }
  return $permissions;
}