You are here

public function VotingApiController::resetVoteAccess in Vote Up/Down 8

Checks if the currentUser is allowed to reset vote.

Return value

\Drupal\Core\Access\AccessResult|\Drupal\Core\Access\AccessResultAllowed The access result.

1 string reference to 'VotingApiController::resetVoteAccess'
vud.routing.yml in ./vud.routing.yml
vud.routing.yml

File

src/Controller/VotingApiController.php, line 157

Class

VotingApiController
Controller for voting.

Namespace

Drupal\vud\Controller

Code

public function resetVoteAccess() {

  // Check if user has permission to vote.
  if (!vud_can_reset_vote($this
    ->currentUser())) {
    return AccessResult::forbidden();
  }
  else {
    return AccessResultAllowed::allowed();
  }
}