You are here

function forum_access in Drupal 6

Same name and namespace in other branches
  1. 4 modules/forum.module \forum_access()
  2. 5 modules/forum/forum.module \forum_access()

Implementation of hook_access().

File

modules/forum/forum.module, line 312
Enable threaded discussions about general topics.

Code

function forum_access($op, $node, $account) {
  switch ($op) {
    case 'create':
      return user_access('create forum topics', $account) ? TRUE : NULL;
    case 'update':
      return user_access('edit any forum topic', $account) || user_access('edit own forum topics', $account) && $account->uid == $node->uid ? TRUE : NULL;
    case 'delete':
      return user_access('delete any forum topic', $account) || user_access('delete own forum topics', $account) && $account->uid == $node->uid ? TRUE : NULL;
  }
}