system_update_6034

Definition

system_update_6034()
modules/system/system.install, line 2148

Description

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

Code

<?php
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;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.