You are here

function quotes_access in Quotes 6

Same name and namespace in other branches
  1. 5 quotes.module \quotes_access()

Implementation of hook_access().

File

./quotes.module, line 42
The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.

Code

function quotes_access($op, $node, $account) {
  switch ($op) {
    case 'create':
      return user_access('create quotes', $account) || user_access('import quotes', $account) || user_access('edit own quotes', $account);
    case 'update':
    case 'delete':
      if (user_access('edit own quotes', $account) && $account->uid == $node->uid) {
        return TRUE;
      }
      if (user_access('administer quotes', $account)) {
        return TRUE;
      }
      return;
    case 'view':
      if (user_access('access quotes', $account)) {
        return TRUE;
      }
      return;
  }
}