You are here

function QuizQuestionController::checkEntityAccess in Quiz 8.5

Same name and namespace in other branches
  1. 8.6 src/Controller/QuizQuestionController.php \Drupal\quiz\Controller\QuizQuestionController::checkEntityAccess()
  2. 6.x src/Controller/QuizQuestionController.php \Drupal\quiz\Controller\QuizQuestionController::checkEntityAccess()

Translate the numeric question index to a question result answer, and run the default entity access check on it.

Parameters

string $op: An entity operation to check.

Quiz $quiz: The quiz.

int $question_number: The question number in the current result.

2 calls to QuizQuestionController::checkEntityAccess()
QuizQuestionController::checkAccess in src/Controller/QuizQuestionController.php
Translate the numeric question index to a question result answer, and run the "take" entity access check on it.
QuizQuestionController::checkFeedbackAccess in src/Controller/QuizQuestionController.php
Translate the numeric question index to a question result answer, and run the "feedback" entity access check on it.

File

src/Controller/QuizQuestionController.php, line 212

Class

QuizQuestionController

Namespace

Drupal\quiz\Controller

Code

function checkEntityAccess($op, $quiz, $question_number) {
  $qra = $this
    ->numberToQuestionResultAnswer($quiz, $question_number);
  return $qra && $qra
    ->access($op) ? \Drupal\Core\Access\AccessResultAllowed::allowed() : \Drupal\Core\Access\AccessResultForbidden::forbidden();
}