You are here

function space_type::access_feature in Spaces 7.3

Same name and namespace in other branches
  1. 6.3 plugins/space_type.inc \space_type::access_feature()
  2. 7 plugins/space_type.inc \space_type::access_feature()

Grant a user access to the specified feature in this space.

Parameters

$op: May be 'view' or 'create'.

$feature: The feature in question to check access for.

$account: Optional: user account object to check against. If omitted, the global $user object (current user) will be used.

Return value

TRUE if access should be granted. FALSE if not.

2 calls to space_type::access_feature()
space_og::access_feature in spaces_og/plugins/space_og.inc
Override of access_feature().
space_user::access_feature in spaces_user/plugins/space_user.inc
Override of access_feature().
2 methods override space_type::access_feature()
space_og::access_feature in spaces_og/plugins/space_og.inc
Override of access_feature().
space_user::access_feature in spaces_user/plugins/space_user.inc
Override of access_feature().

File

plugins/space_type.inc, line 99

Class

space_type
Common functionality for space types that implement access, routing, delegated Views filtering and feature management concepts. Examples: spaces_og, spaces_user, spaces_taxonomy.

Code

function access_feature($op = 'view', $feature, $account = NULL) {
  $usable = spaces_features($this->type);
  $features = $this->controllers->variable
    ->get('spaces_features');
  return user_access('access content', $account) && isset($usable[$feature]) && !empty($features[$feature]);
}