yii\debug\Module::checkAccess PHP Method

checkAccess() protected method

Checks if current user is allowed to access the module
protected checkAccess ( ) : boolean
return boolean if access is granted
    protected function checkAccess()
    {
        $ip = Yii::$app->getRequest()->getUserIP();
        foreach ($this->allowedIPs as $filter) {
            if ($filter === '*' || $filter === $ip || ($pos = strpos($filter, '*')) !== false && !strncmp($ip, $filter, $pos)) {
                return true;
            }
        }
        foreach ($this->allowedHosts as $hostname) {
            $filter = gethostbyname($hostname);
            if ($filter === $ip) {
                return true;
            }
        }
        Yii::warning('Access to debugger is denied due to IP address restriction. The requesting IP address is ' . $ip, __METHOD__);
        return false;
    }