Nette\Security\Permission::checkRole PHP Метод

checkRole() приватный Метод

Checks whether Role is valid and exists in the list.
private checkRole ( $role, $need = TRUE ) : void
Результат void
    private function checkRole($role, $need = TRUE)
    {
        if (!is_string($role) || $role === '') {
            throw new Nette\InvalidArgumentException('Role must be a non-empty string.');
        } elseif ($need && !isset($this->roles[$role])) {
            throw new Nette\InvalidStateException("Role '{$role}' does not exist.");
        }
    }