You are here

public function CreateUser::CreateUserAccess in Subuser 8

1 call to CreateUser::CreateUserAccess()
CreateUser::access in lib/Drupal/subuser/Controller/CreateUser.php

File

lib/Drupal/subuser/Controller/CreateUser.php, line 20

Class

CreateUser

Namespace

Drupal\subuser\Controller

Code

public function CreateUserAccess($account) {
  foreach (user_roles(TRUE) as $rid => $role) {
    if ($account
      ->hasPermission('create subuser ' . $rid)) {
      return AccessInterface::ALLOW;
    }
  }
  return AccessInterface::DENY;
}