You are here

function user_role_configuration_rebuild in Configuration Management 7

Implements hook_configuration_rebuild().

1 call to user_role_configuration_rebuild()
user_role_configuration_revert in includes/configuration.user.inc
Implements hook_configuration_revert().

File

includes/configuration.user.inc, line 212

Code

function user_role_configuration_rebuild($identifiers, $module_name = 'configuration') {
  if ($defaults = configuration_get_default('user_role', $module_name)) {
    foreach ($defaults as $role) {
      if (in_array($role['name'], $identifiers) || !empty($identifiers) && $identifiers[0] == '#import_all') {
        $role = (object) $role;
        if ($existing = user_role_load_by_name($role->name)) {
          $role->rid = $existing->rid;
        }
        user_role_save($role);
        configuration_check_user_role($role->name);
      }
    }
    cache_clear_all('config_export', 'cache');
  }
}