You are here

function _environment_readonly_update_permissions in Environment 7

Update all permission configuration.

1 call to _environment_readonly_update_permissions()
environment_readonly_environment_switch in modules/environment_readonly/environment_readonly.module
Implements hook_environment_switch().

File

modules/environment_readonly/environment_readonly.module, line 221
Code for the Environment Readonly module.

Code

function _environment_readonly_update_permissions() {
  $revert = array();
  features_include();
  features_include_defaults('user_permission');
  module_load_include('inc', 'features', 'features.export');

  // Clear cache just in case.
  features_get_default('user_permission', NULL, TRUE, TRUE);
  $modules = module_implements('user_default_permissions');
  foreach ($modules as $module) {
    $revert[$module][] = 'user_permission';
  }
  if (!empty($revert)) {
    features_revert($revert);
  }
}