function QuizQuestionController::checkEntityAccess in Quiz 8.5
Same name and namespace in other branches
- 8.6 src/Controller/QuizQuestionController.php \Drupal\quiz\Controller\QuizQuestionController::checkEntityAccess()
- 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
Namespace
Drupal\quiz\ControllerCode
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();
}