You are here

function spaces_plugin_access_spaces_feature::access in Spaces 7

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

Check access directly.

Overrides views_plugin_access::access

File

includes/spaces_plugin_access_spaces_feature.inc, line 18

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 access($account) {
  $feature = $this->options['spaces_feature'] == 0 ? $this
    ->get_my_feature() : $this->options['spaces_feature'];
  if (!empty($this->options['perm'])) {
    return spaces_access_feature_perms('view', $feature, NULL, NULL, array(
      $this->options['perm'],
    ));
  }
  return spaces_access_feature('view', $feature, NULL);
}