You are here

function entity_print_update_8101 in Entity Print 8

Same name and namespace in other branches
  1. 8.2 entity_print.install \entity_print_update_8101()

Upgrade the permissions inline with the more granular permissions.

File

./entity_print.install, line 61
Entity Print installation file.

Code

function entity_print_update_8101() {
  $roles = user_roles();
  foreach ($roles as $role) {
    if ($role
      ->hasPermission('entity print access')) {
      $role
        ->grantPermission('bypass entity print access');
      $role
        ->revokePermission('entity print access');
      $role
        ->save();
    }
  }
}