Nette\Security\Permission::checkResource PHP Method

checkResource() private method

Checks whether Resource is valid and exists in the list.
private checkResource ( $resource, $need = TRUE ) : void
return void
    private function checkResource($resource, $need = TRUE)
    {
        if (!is_string($resource) || $resource === '') {
            throw new Nette\InvalidArgumentException('Resource must be a non-empty string.');
        } elseif ($need && !isset($this->resources[$resource])) {
            throw new Nette\InvalidStateException("Resource '{$resource}' does not exist.");
        }
    }