You are here

function hook_fivestar_access in Fivestar 7.2

Same name and namespace in other branches
  1. 8 fivestar.api.php \hook_fivestar_access()

Implements hook_fivestar_access().

This hook is called before every vote is cast through Fivestar. It allows modules to allow or deny voting on any type of entity, such as nodes, users, or comments.

Parameters

$entity_type: Type entity.

$id: Identifier within the type.

$tag: The VotingAPI tag string.

$uid: The user ID trying to cast the vote.

Return value

bool|null Returns TRUE if voting is supported on this object. Returns NULL if voting is not supported on this object by this module. If needing to absolutely deny all voting on this object, regardless of permissions defined in other modules, return FALSE. Note if all modules return NULL, stating no preference, then access will be denied.

See also

fivestar_validate_target()

fivestar_fivestar_access()

1 function implements hook_fivestar_access()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

fivestar_fivestar_access in ./fivestar.module
Implements hook_fivestar_access().
1 invocation of hook_fivestar_access()
fivestar_validate_target in ./fivestar.module
Check that an item being voted upon is a valid vote.

File

./fivestar.api.php, line 57
Provides API documentation for the fivestar module.

Code

function hook_fivestar_access($entity_type, $id, $tag, $uid) {
  if ($uid == 1) {

    // We are never going to allow the admin user case a fivestar vote.
    return FALSE;
  }
}