You are here

function _advpoll_votes_access in Advanced Poll 7

Same name and namespace in other branches
  1. 6.3 advpoll.module \_advpoll_votes_access()
  2. 6 advpoll.module \_advpoll_votes_access()
  3. 6.2 advpoll.module \_advpoll_votes_access()
  4. 7.3 advpoll.module \_advpoll_votes_access()
  5. 7.2 advpoll.module \_advpoll_votes_access()

Votes access callback.

Determines who is able to see the individual votes linked to user id or anonymous id. Users with administer poll access can always see this page.

Parameters

$node: An advanced poll node.

Return value

Returns true or false

1 string reference to '_advpoll_votes_access'
advpoll_menu in ./advpoll.module
Implements hook_menu()

File

./advpoll.module, line 932

Code

function _advpoll_votes_access($node) {
  if ($node->type == 'advpoll') {
    $data = advpoll_get_data($node);
    $votes = advpoll_get_votes($node->nid);
    return $votes['total'] > 0 && (user_access('inspect all votes') && $data->show_votes || user_access('administer polls'));
  }
}