function views_access

cis7 views.module views_access()
cle7 views.module views_access()
elmsmedia7 views.module views_access()
icor7 views.module views_access()
meedjum_blog7 views.module views_access()
mooc7 views.module views_access()

Determine if the logged in user has access to a view.

This function should only be called from a menu hook or some other embedded source. Each argument is the result of a call to views_plugin_access::get_access_callback() which is then used to determine if that display is accessible. If *any* argument is accessible, then the view is accessible.

1 string reference to 'views_access'
views_plugin_display_page::execute_hook_menu in sites/all/modules/ulmus/views/plugins/views_plugin_display_page.inc
Add this display's path information to Drupal's menu system.

File

sites/all/modules/ulmus/views/views.module, line 956
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_access() {
  $args = func_get_args();
  foreach ($args as $arg) {
    if ($arg === TRUE) {
      return TRUE;
    }

    if (!is_array($arg)) {
      continue;
    }

    list($callback, $arguments) = $arg;
    $arguments = $arguments ? $arguments : array();
    // Bring dynamic arguments to the access callback.
    foreach ($arguments as $key => $value) {
      if (is_int($value) && isset($args[$value])) {
        $arguments[$key] = $args[$value];
      }
    }
    if (function_exists($callback) && call_user_func_array($callback, $arguments)) {
      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.