public function VotingApiController::voteAccess in Vote Up/Down 8
Checks if the currentUser is allowed to vote.
Return value
\Drupal\Core\Access\AccessResult|\Drupal\Core\Access\AccessResultAllowed The access result.
1 string reference to 'VotingApiController::voteAccess'
File
- src/
Controller/ VotingApiController.php, line 141
Class
- VotingApiController
- Controller for voting.
Namespace
Drupal\vud\ControllerCode
public function voteAccess() {
// Check if user has permission to vote.
if (!vud_can_vote($this
->currentUser())) {
return AccessResult::forbidden();
}
else {
return AccessResultAllowed::allowed();
}
}