Skip to content
Snippets Groups Projects
Commit 436838ee authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3419771: Remove deprecated function user_roles()

parent a1d49de4
Branches
Tags
No related merge requests found
Pipeline #89690 passed with warnings
......@@ -13,6 +13,7 @@ use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\user\Entity\Role;
/**
* Manages entity type plugin definitions.
......@@ -358,7 +359,9 @@ class WorkflowManager implements WorkflowManagerInterface {
*/
public static function participateUserRoles(EntityInterface $workflow) {
$type_id = $workflow->id();
foreach (user_roles() as $rid => $role) {
$roles = Role::loadMultiple();
foreach ($roles as $rid => $role) {
$perms = ["create $type_id workflow_transition" => 1];
user_role_change_permissions($rid, $perms); // <=== Enable Roles.
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment