You are here

function vote_up_down_node_access in Vote Up/Down 6

Check whether the current user has access to the given permission for the given node. This requires both that they have access the required permission, and that the node type is enabled for vote up/down.

Parameters

$node: A node object

$perm: (Optional) the name of a permission to pass to user_access()

Return value

boolean TRUE if the user has access to the node vote up/down statistics.

1 call to vote_up_down_node_access()
vote_up_down_block in ./vote_up_down.module
Implementation of hook_block().
1 string reference to 'vote_up_down_node_access'
vote_up_down_menu in ./vote_up_down.module
Implementation of hook_menu().

File

./vote_up_down.module, line 868

Code

function vote_up_down_node_access($node, $perm = 'access vote up/down statistics') {
  if (user_access($perm)) {
    return in_array($node->type, variable_get('vote_up_down_node_types', array()), TRUE);
  }
  return FALSE;
}