You are here

function quiz_access in Quiz 5

Same name and namespace in other branches
  1. 5.2 quiz.module \quiz_access()
  2. 6.6 quiz.module \quiz_access()
  3. 6.2 quiz.module \quiz_access()
  4. 6.3 quiz.module \quiz_access()
  5. 6.4 quiz.module \quiz_access()
  6. 6.5 quiz.module \quiz_access()
  7. 7.5 quiz.module \quiz_access()

Implementation of hook_access().

File

./quiz.module, line 41
Quiz Module

Code

function quiz_access($op, $node) {
  global $user;
  if ($op == 'view') {
    return user_access('access quiz');
  }
  if ($op == 'create') {
    return user_access('create quiz');
  }
  if ($op == 'update' || $op == 'delete') {
    if (user_access('create quiz') && $user->uid == $node->uid) {
      return TRUE;
    }
  }
  if (user_access('administer quiz')) {
    return TRUE;
  }
}