You are here

function _user_features_save_roles in Features 6

Save/update an array of roles to the database.

2 calls to _user_features_save_roles()
FeaturesUserTestCase::_test_user_permission in tests/features.test
user_permission_features_rebuild in includes/features.user.inc
Implementation of hook_features_rebuild(). Iterate through default permissions and update the permissions map.

File

includes/features.user.inc, line 265

Code

function _user_features_save_roles($roles) {

  // Write the updated permissions.
  foreach ($roles as $role) {
    db_query("DELETE FROM {permission} WHERE rid = %d", $role['rid']);
    $role['perm'] = implode(', ', $role['perm']);
    drupal_write_record('permission', $role);
  }
}