You are here

function system_update_6034 in Drupal 6

Rename permission "administer access control" to "administer permissions".

Related topics

File

modules/system/system.install, line 2241

Code

function system_update_6034() {
  $ret = array();
  $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
  while ($role = db_fetch_object($result)) {
    $renamed_permission = preg_replace('/administer access control/', 'administer permissions', $role->perm);
    if ($renamed_permission != $role->perm) {
      $ret[] = update_sql("UPDATE {permission} SET perm = '{$renamed_permission}' WHERE rid = {$role->rid}");
    }
  }
  return $ret;
}