function sheetnode_access in Sheetnode 5
Same name and namespace in other branches
- 6 sheetnode.module \sheetnode_access()
Implementation of hook_access().
File
- ./
sheetnode.module, line 34
Code
function sheetnode_access($op, $node, $account = NULL) {
global $user;
if (empty($account)) {
$account = $user;
}
if ($op == 'create') {
return user_access('create sheetnode', $account) ? TRUE : NULL;
}
if ($op == 'update') {
return user_access('edit any sheetnode', $account) || user_access('edit own sheetnode', $account) && $account->uid == $node->uid ? TRUE : NULL;
}
if ($op == 'delete') {
return user_access('delete any sheetnode', $account) || user_access('delete own sheetnode', $account) && $account->uid == $node->uid ? TRUE : NULL;
}
}