function user_role_features_rebuild in Features 7.2
Same name and namespace in other branches
- 6 includes/features.user.inc \user_role_features_rebuild()
- 7 includes/features.user.inc \user_role_features_rebuild()
Implements hook_features_rebuild().
1 call to user_role_features_rebuild()
- user_role_features_revert in includes/
features.user.inc - Implements hook_features_revert().
File
- includes/
features.user.inc, line 238 - Features integration for 'user' module.
Code
function user_role_features_rebuild($module) {
if ($defaults = features_get_default('user_role', $module)) {
foreach ($defaults as $role) {
$role = (object) $role;
if ($existing = user_role_load_by_name($role->name)) {
$role->rid = $existing->rid;
}
user_role_save($role);
}
}
}