function quiz_question_node_access_records in Quiz 7.4
Same name and namespace in other branches
- 7.6 question_types/quiz_question/quiz_question.module \quiz_question_node_access_records()
- 7.5 question_types/quiz_question/quiz_question.module \quiz_question_node_access_records()
Implements hook_node_access_records().
File
- question_types/
quiz_question/ quiz_question.module, line 957 - Quiz Question module. This module provides the basic facilities for adding quiz question types to a quiz.
Code
function quiz_question_node_access_records($node) {
$grants = array();
// Restricting view access to question nodes outside quizzes.
$question_types = _quiz_question_get_implementations();
$question_types = array_keys($question_types);
if (in_array($node->type, $question_types)) {
// This grant is for users having 'view quiz question outside of a quiz'
// permission. We set a priority of 2 because OG has a 1 priority and we
// want to get around it.
$grants[] = array(
'realm' => 'quiz_question',
'gid' => 1,
'grant_view' => 1,
'grant_update' => 0,
'grant_delete' => 0,
'priority' => 2,
);
}
return $grants;
}