You are here

function certificate_access in Certificate 6.2

Same name and namespace in other branches
  1. 8.3 certificate.module \certificate_access()
  2. 6 certificate.module \certificate_access()
  3. 7.3 certificate.module \certificate_access()

Implementation of hook_access().

File

./certificate.module, line 32
Certificate module.

Code

function certificate_access($op, $node, $account) {
  if ($op == 'create') {
    return user_access('create certificate content', $account);
  }
  if ($op == 'update') {
    if (user_access('edit any certificate content', $account) || user_access('edit own certificate content', $account) && $account->uid == $node->uid) {
      return TRUE;
    }
  }
  if ($op == 'delete') {
    if (user_access('delete any certificate content', $account) || user_access('delete own certificate content', $account) && $account->uid == $node->uid) {
      return TRUE;
    }
  }
}