Piwik\Plugin\Controller::checkSitePermission PHP Method

checkSitePermission() protected method

protected checkSitePermission ( )
    protected function checkSitePermission()
    {
        if (!empty($this->idSite) && empty($this->site)) {
            throw new NoAccessException(Piwik::translate('General_ExceptionPrivilegeAccessWebsite', array("'view'", $this->idSite)));
        } elseif (empty($this->site) || empty($this->idSite)) {
            throw new Exception("The requested website idSite is not found in the request, or is invalid.\n\t\t\t\tPlease check that you are logged in Piwik and have permission to access the specified website.");
        }
    }