You are here

function spaces_plugin_access_spaces_feature::get_access_callback in Spaces 7.3

Same name and namespace in other branches
  1. 6.3 includes/spaces_plugin_access_spaces_feature.inc \spaces_plugin_access_spaces_feature::get_access_callback()
  2. 6 includes/spaces_plugin_access_spaces_feature.inc \spaces_plugin_access_spaces_feature::get_access_callback()
  3. 6.2 includes/spaces_plugin_access_spaces_feature.inc \spaces_plugin_access_spaces_feature::get_access_callback()
  4. 7 includes/spaces_plugin_access_spaces_feature.inc \spaces_plugin_access_spaces_feature::get_access_callback()

Provide the access check as a callback.

Overrides views_plugin_access::get_access_callback

File

includes/spaces_plugin_access_spaces_feature.inc, line 29

Class

spaces_plugin_access_spaces_feature
Provides access control for views by checking against the current space's feature settings. Optionally allows a permission to be checked in addition to the first feature access control check.

Code

function get_access_callback() {
  $feature = empty($this->options['spaces_feature']) ? $this
    ->get_my_feature() : $this->options['spaces_feature'];
  if (!empty($this->options['perm'])) {
    return array(
      'spaces_access_feature_perms',
      array(
        'view',
        $feature,
        NULL,
        NULL,
        array(
          $this->options['perm'],
        ),
      ),
    );
  }
  return array(
    'spaces_access_feature',
    array(
      'view',
      $feature,
      NULL,
    ),
  );
}