You are here

function features_access_override_actions in Features 7.2

Same name and namespace in other branches
  1. 6 features.module \features_access_override_actions()
  2. 7 features.module \features_access_override_actions()

Menu access callback for 'admin/structure/features/%feature/diff'.

Checks whether a user should be able to access override actions for a given feature.

Parameters

\stdClass $feature: Feature module object.

Return value

bool TRUE to give access, FALSE to deny access.

1 string reference to 'features_access_override_actions'
features_menu in ./features.module
Implements hook_menu().

File

./features.module, line 1108
Main *.module file for the 'features' module.

Code

function features_access_override_actions($feature) {
  if (user_access('administer features')) {
    static $access = array();
    if (!isset($access[$feature->name])) {

      // Set a value first. We may get called again from within
      // features_detect_overrides().
      $access[$feature->name] = FALSE;
      features_include();
      module_load_include('inc', 'features', 'features.export');
      $access[$feature->name] = in_array(features_get_storage($feature->name), array(
        FEATURES_DEFAULT,
        FEATURES_OVERRIDDEN,
        FEATURES_NEEDS_REVIEW,
      ));
    }
    return $access[$feature->name];
  }
  return FALSE;
}