You are here

function og_features_role_features_rebuild in Organic groups 7.2

Implements hook_features_rebuild().

Iterates through default permissions and update the permissions map.

Parameters

string $module: The modules whose default roles should be rebuild.

1 call to og_features_role_features_rebuild()
og_features_role_features_revert in includes/og_features_role.features.inc
Implements hook_features_revert().

File

includes/og_features_role.features.inc, line 106
Integration with features for og roles.

Code

function og_features_role_features_rebuild($module) {
  if ($defaults = features_get_default('og_features_role', $module)) {
    foreach ($defaults as $key => $value) {
      list($group_type, $bundle, $name) = explode(':', $key);
      $role = (object) $value;
      if ($rid = _og_features_role_exists($name, $group_type, $bundle)) {
        $role->rid = $rid;
      }
      og_role_save($role);
    }
  }
}