You are here

public function views_plugin_display::access in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_display.inc \views_plugin_display::access()
  2. 6.2 plugins/views_plugin_display.inc \views_plugin_display::access()

Determine if the user has access to this display of the view.

1 call to views_plugin_display::access()
views_plugin_display_attachment::attach_to in plugins/views_plugin_display_attachment.inc
Attach to another view.

File

plugins/views_plugin_display.inc, line 2829
Definition of views_plugin_display.

Class

views_plugin_display
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Code

public function access($account = NULL) {
  if (!isset($account)) {
    global $user;
    $account = $user;
  }

  // Full override.
  if (user_access('access all views', $account)) {
    return TRUE;
  }
  $plugin = $this
    ->get_plugin('access');
  if ($plugin) {
    return $plugin
      ->access($account);
  }

  // Fallback to all access if no plugin.
  return TRUE;
}