You are here

function multichoice_access in Quiz 6.2

Same name and namespace in other branches
  1. 5.2 multichoice.module \multichoice_access()
  2. 5 multichoice.module \multichoice_access()
  3. 6.6 question_types/multichoice/multichoice.module \multichoice_access()
  4. 6.3 question_types/multichoice/multichoice.module \multichoice_access()
  5. 6.5 question_types/multichoice/multichoice.module \multichoice_access()

Implementation of hook_access().

File

./multichoice.module, line 27
Multiple choice question type for the Quiz module.

Code

function multichoice_access($op, $node, $account) {
  if (!$account) {
    global $user;
    $account = $user;
  }
  if ($op == 'view') {
    return user_access('create multichoice', $account);
  }
  if ($op == 'create') {
    return user_access('create multichoice', $account);
  }
  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own multichoice', $account) && $account->uid == $node->uid) {
      return TRUE;
    }
  }
}