You are here

function biblio_access in Bibliography Module 6

Same name and namespace in other branches
  1. 5 biblio.module \biblio_access()
  2. 6.2 biblio.module \biblio_access()
  3. 7.3 biblio.module \biblio_access()
  4. 7 biblio.module \biblio_access()
  5. 7.2 biblio.module \biblio_access()

Implementation of hook_access().

Node modules may implement node_access() to determine the operations users may perform on nodes. This example uses a very common access pattern.

6 calls to biblio_access()
biblio_import_form in ./biblio.import.export.inc
Return a form used to import files into biblio.
biblio_link in ./biblio.module
Implementation of hook_link().
biblio_show_results in ./biblio.pages.inc
biblio_show_results takes the query results from biblio_db_search and adds some controls to the page then loops through the results applying the selected style to each entry
theme_biblio_entry in ./biblio_theme.inc
theme_biblio_long in ./biblio_theme.inc
DEPRECIATED! this was the original output format which is not to flexable it will be removed TODO: remove this function

... See full list

1 string reference to 'biblio_access'
biblio_menu in ./biblio.module
Implementation of hook_menu().

File

./biblio.module, line 387

Code

function biblio_access($op, $node = '', $user = '') {
  switch ($op) {
    case 'create':
      return user_access('create biblio');
    case 'delete':
    case 'update':
      if (user_access('edit all biblio entries')) {
        return TRUE;
      }
      if (user_access('edit own biblio entries') && $user->uid == $node->uid) {
        return TRUE;
      }
      if (user_access('edit own biblio entries') && $user->uid != $node->uid) {
        return;
      }
      break;
    case 'view':
      if (variable_get('biblio_view_only_own', 0) && $user->uid != $node->uid) {
        return FALSE;
      }
      break;
    case 'admin':
      return user_access('administer biblio');
    case 'import':
      return user_access('import from file');
    case 'export':
      return user_access('show export links');
    case 'edit_author':
      if (user_access('administer biblio') || user_access('edit biblio authors')) {
        return TRUE;
      }
      break;
    case 'download':
      if (user_access('show download links') || user_access('show own download links') && $user->uid == $node->uid) {
        return TRUE;
      }
      break;
    case 'rss':
      return variable_get('biblio_rss', 0);
    default:
  }
  return;
}