function node_perm in Drupal 6
Same name and namespace in other branches
- 4 modules/node.module \node_perm()
- 5 modules/node/node.module \node_perm()
Implementation of hook_perm().
File
- 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;
}