You are here

function exif_custom_update_7102 in EXIF Custom 7

Change permission name.

File

./exif_custom.install, line 128
Schema and update hook implementations for the EXIF Custom module.

Code

function exif_custom_update_7102() {
  $roles = user_roles();
  $permissions_new = array(
    'administer exif_custom',
  );
  foreach ($roles as $key => $value) {
    $role_load = user_role_load_by_name($value);
    $roles_l = array(
      $role_load->rid => $role_load->name,
    );
    $role_permissions = user_role_permissions($roles_l);
    $permissions = $role_permissions[$role_load->rid];
    if (isset($permissions['administer image metadata'])) {
      user_role_grant_permissions($role_load->rid, $permissions_new);
    }
  }
}