node_content_access($op, $node)
node/node.module, line 3038
Implementation of hook_access().
| Name | Description |
|---|---|
| Hook implementations for user-created content types. |
<?php
function node_content_access($op, $node) {
global $user;
$type = is_string($node) ? $node : (is_array($node) ? $node['type'] : $node->type);
if ($op == 'create') {
return user_access('create '. $type .' content');
}
if ($op == 'update' || $op == 'delete') {
if (user_access('edit '. $type .' content') || (user_access('edit own '. $type .' content') && ($user->uid == $node->uid))) {
return TRUE;
}
}
}
?>