You are here

public function uc_addresses_views_access::get_access_callback in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 views/uc_addresses_views_access.inc \uc_addresses_views_access::get_access_callback()

Implements views_plugin_access#get_access_callback().

Overrides views_plugin_access::get_access_callback

File

views/uc_addresses_views_access.inc, line 155
Contains uc_addresses_views_access class.

Class

uc_addresses_views_access
Access plugin that provides access control based on custom PHP code.

Code

public function get_access_callback() {

  // Find out at which position in the path the given argument is.
  if (isset($this->display->display_options['path'])) {
    $positions = $this
      ->uc_addresses_find_arg_positions($this->display->display_options['path']);
    return array(
      'uc_addresses_check_access_by_ids',
      array(
        $this->options['access_type'],
        $positions['uid'],
        $positions['aid'],
      ),
    );
  }

  // If no path is applied for this display, then there are no restrictions.
  return TRUE;
}