function example_access in Coder 7.2
Same name and namespace in other branches
- 7 coder_upgrade/tests/old/samples/example.module \example_access()
Implement hook_access.
http://drupal.org/node/224333#hook_node_access
File
- coder_upgrade/
tests/ old/ samples/ example.module, line 360
Code
function example_access($op, $node, $account) {
if ($op == 'create') {
return user_access('create stories', $account);
}
if ($op == 'update' || $op == 'delete') {
if (user_access('edit own stories', $account) && $account->uid == $node->uid) {
return TRUE;
}
}
}