You are here

function view_unpublished_perm in view_unpublished 6

Same name and namespace in other branches
  1. 5 view_unpublished.module \view_unpublished_perm()

Implementation of hook_perm().

Adds a global 'view all unpublished content' permission and also a new permission for each content type.

File

./view_unpublished.module, line 15
Allow users to view all unpublished nodes, or unpublished nodes of a specific type.

Code

function view_unpublished_perm() {
  $perms = array(
    'view all unpublished content',
  );
  foreach (node_get_types() as $type => $name) {
    $perms[] = 'view unpublished ' . $type . ' content';
  }
  return $perms;
}