You are here

function sheetnode_access in Sheetnode 6

Same name and namespace in other branches
  1. 5 sheetnode.module \sheetnode_access()

Implementation of hook_access().

File

./sheetnode.module, line 34

Code

function sheetnode_access($op, $node, $account) {
  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;
  }
}