You are here

function imagecache_external_update_7103 in Imagecache External 7.2

Fix permission naming when upgrading from older versions and clean up old permissions.

File

./imagecache_external.install, line 80
(Un)install and update functions.

Code

function imagecache_external_update_7103() {
  db_update('role_permission')
    ->fields(array(
    'permission' => 'administer imagecache external',
  ))
    ->condition('permission', 'Administer imagecache external', '=')
    ->execute();
  db_delete('role_permission')
    ->condition('module', 'imagecache_external', '=')
    ->condition('permission', 'administer imagecache external', 'NOT LIKE')
    ->execute();
}