You are here

class CreateUser in Subuser 8

Hierarchy

  • class \Drupal\subuser\Controller\CreateUser extends \Drupal\user\AccountFormController

Expanded class hierarchy of CreateUser

File

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

Namespace

Drupal\subuser\Controller
View source
class CreateUser extends AccountFormController {
  public function access(Request $request) {
    $account = $this
      ->currentUser();
    return $this
      ->CreateUserAccess($account);
  }
  public function CreateUserAccess($account) {
    foreach (user_roles(TRUE) as $rid => $role) {
      if ($account
        ->hasPermission('create subuser ' . $rid)) {
        return AccessInterface::ALLOW;
      }
    }
    return AccessInterface::DENY;
  }

}

Members