function view::access

cis7 view.inc view::access($displays = NULL, $account = NULL)
cle7 view.inc view::access($displays = NULL, $account = NULL)
elmsmedia7 view.inc view::access($displays = NULL, $account = NULL)
icor7 view.inc view::access($displays = NULL, $account = NULL)
meedjum_blog7 view.inc view::access($displays = NULL, $account = NULL)
mooc7 view.inc view::access($displays = NULL, $account = NULL)

Determine if the given user has access to the view. Note that this sets the display handler if it hasn't been.

File

sites/all/modules/ulmus/views/includes/view.inc, line 1482
Provides the view object type and associated methods.

Class

view
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Code

function access($displays = NULL, $account = NULL) {
  // Noone should have access to disabled views.
  if (!empty($this->disabled)) {
    return FALSE;
  }

  if (!isset($this->current_display)) {
    $this->init_display();
  }

  if (!$account) {
    $account = $GLOBALS['user'];
  }

  // We can't use choose_display() here because that function
  // calls this one.
  $displays = (array) $displays;
  foreach ($displays as $display_id) {
    if (!empty($this->display[$display_id]->handler)) {
      if ($this->display[$display_id]->handler->access($account)) {
        return TRUE;
      }
    }
  }

  return FALSE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.