function RolesOptions::getPossibleOptions

Overrides OptionsProviderInterface::getPossibleOptions

File

src/TypedData/Options/RolesOptions.php, line 15

Class

RolesOptions
Options provider to return a list of user roles.

Namespace

Drupal\rules\TypedData\Options

Code

public function getPossibleOptions(AccountInterface $account = NULL) {
    // Use parameter FALSE to include 'Anonymous'.
    $roles = user_role_names(FALSE);
    // Sort by the role name.
    asort($roles);
    return $roles;
}