You are here

function quiz_access in Quiz 6.2

Same name and namespace in other branches
  1. 5.2 quiz.module \quiz_access()
  2. 5 quiz.module \quiz_access()
  3. 6.6 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 88
Quiz Module

Code

function quiz_access($op, $node, $account) {
  switch ($op) {
    case 'view':
      return user_access('access quiz');
    case 'create':
      return user_access('create quiz');
    case 'update':
    case 'delete':

      // This doesn't look right...
      return user_access('create quiz') && $user->uid == $node->uid;
    default:
      return user_access('administer quiz');
  }
}