function node_perm

6.x node.module node_perm()

Implementation of hook_perm().

File

drupal-6.x/modules/node/node.module, line 1138
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_perm() {
  $perms = array('administer content types', 'administer nodes', 'access content', 'view revisions', 'revert revisions', 'delete revisions');

  foreach (node_get_types() as $type) {
    if ($type->module == 'node') {
      $name = check_plain($type->type);
      $perms[] = 'create ' . $name . ' content';
      $perms[] = 'delete own ' . $name . ' content';
      $perms[] = 'delete any ' . $name . ' content';
      $perms[] = 'edit own ' . $name . ' content';
      $perms[] = 'edit any ' . $name . ' content';
    }
  }

  return $perms;
}