You are here

protected function BulkUserRegistration::getAllowedRoles in Bulk User Registration 8

The roles allowed to import.

Return value

array An associative array with the role id as the key and the role name as value.

1 call to BulkUserRegistration::getAllowedRoles()
BulkUserRegistration::createUser in src/BulkUserRegistration.php
Creates and saves a user.

File

src/BulkUserRegistration.php, line 155

Class

BulkUserRegistration
The BulkUserRegistration service.

Namespace

Drupal\bulk_user_registration

Code

protected function getAllowedRoles() {
  $allowedRoles = \Drupal::config('bulk_user_registration.settings')
    ->get('allowed_roles');
  return array_intersect_key(user_role_names(TRUE), array_flip(array_filter($allowedRoles)));
}