You are here

function node_view_permissions_permission in Node View Permissions 7

Implements hook_permission().

File

./node_view_permissions.module, line 31

Code

function node_view_permissions_permission() {
  $perms = array();
  if (node_view_permissions_get_configured_types() != NULL) {
    foreach (node_view_permissions_get_configured_types() as $type) {
      $info = node_type_get_type($type);
      $perms += array(
        "view own {$type} content" => array(
          'title' => t('%type_name: View own content', array(
            '%type_name' => $info->name,
          )),
        ),
        "view any {$type} content" => array(
          'title' => t('%type_name: View any content', array(
            '%type_name' => $info->name,
          )),
        ),
      );
    }
  }
  return $perms;
}