You are here

function node_perm in Drupal 5

Same name and namespace in other branches
  1. 4 modules/node.module \node_perm()
  2. 6 modules/node/node.module \node_perm()

Implementation of hook_perm().

File

modules/node/node.module, line 833
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',
  );
  foreach (node_get_types() as $type) {
    if ($type->module == 'node') {
      $name = check_plain($type->type);
      $perms[] = 'create ' . $name . ' content';
      $perms[] = 'edit own ' . $name . ' content';
      $perms[] = 'edit ' . $name . ' content';
    }
  }
  return $perms;
}