You are here

function _quiz_status_access in Quiz 5

Same name and namespace in other branches
  1. 5.2 quiz.module \_quiz_status_access()

Determine who should have access to the Take Quiz tab depending on the quiz status

1 call to _quiz_status_access()
quiz_menu in ./quiz.module
Implementation of hook_menu().

File

./quiz.module, line 1513
Quiz Module

Code

function _quiz_status_access($node) {
  $access = FALSE;
  $status = _quiz_availability($node);
  switch ($status) {
    case 'closed':
    case 'future':
      $access = user_access('administer quiz');
      break;
    case 'open':
      $access = user_access('access quiz') && $node->status;
      break;
  }
  return $access;
}