You are here

function poll_access in Drupal 6

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

Implementation of hook_access().

File

modules/poll/poll.module, line 62
Enables your site to capture votes on different topics in the form of multiple choice questions.

Code

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