You are here

function advpoll_access in Advanced Poll 5

Same name and namespace in other branches
  1. 6.3 advpoll.module \advpoll_access()
  2. 6 advpoll.module \advpoll_access()
  3. 6.2 advpoll.module \advpoll_access()

Implementation of hook_access().

File

./advpoll.module, line 41
Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.

Code

function advpoll_access($op, $node) {
  global $user;
  if ($op == 'create') {
    return user_access('create polls');
  }
  if ($op == 'update') {
    if (user_access('edit polls') || $node->uid == $user->uid && user_access('edit own polls')) {
      return TRUE;
    }
  }
}