An easier way to get all the roles Another way to get all the roles would be using the "user_roles()" function, that function even filter the anonymous users if we want to. https://api.drupal.org/api/drupal/core%21modules%21user%21user.module/function/user_roles/8.6.x Reply