Determine if Cachet is allowed to send notifications to users, subscribers or third party tools.

@return bool
197446
public function canNotifySubscribers()
    {
        $maintenancePeriods = Schedule::inProgress()->count();
        if ($maintenancePeriods === 0) {
            return true;
        }

        return !$this->config->get('setting.suppress_notifications_in_maintenance');
    }
317183
public function isPageCacheable()
    {
        $result = false;
        $pragma = $this->response->getHeader('pragma');

        if ($pragma) {
            $result = $pragma->getFieldValue() === 'cache';
        }

        return $result;
    }
1036469
public function isAccessible()
    {
        $loop = $this;
        $access = true;

        while ($loop->getReply() != null) {
            $loop = $loop->getReply();

            if ($loop->getSpam() == 1 || $loop->getActive() == 0 || $loop->isEmailValid() == 0) {
                $access = false;
            }
        }

        return $access;
    }
1263566
public function canRead()
    {
        if ($this->getRequest()->get('layout') == 'add') {
            return $this->_mixer->canAdd();
        }

        if ($this->getItem() && $this->getItem()->authorize('access')) {
            return true;
        }

        return false;
    }
614831
public function isObsolete()
    {
        if ($this->refreshNthRequests == 1 || $this->isRefreshNeededByProbability()) {
            return true;
        }
        if (isset($_SESSION['__HANDLER_REQUESTS_BEFORE_REFRESH'])) {
            if ($_SESSION['__HANDLER_REQUESTS_BEFORE_REFRESH'] <= 1) {
                return true; // @codeCoverageIgnore
            }
            $_SESSION['__HANDLER_REQUESTS_BEFORE_REFRESH']--;
        }
        if (isset($_SESSION['__HANDLER_SECONDS_BEFORE_REFRESH'])) {
            $timeDifference = time() - $_SESSION['__HANDLER_LAST_ACTIVITY_TIMESTAMP'];
            if ($timeDifference >= $_SESSION['__HANDLER_SECONDS_BEFORE_REFRESH']) {
                return true;
            }
        }
        return false;
    }
755248
public function isHintEnabled()
    {
        $isParamPresent = $this->_request->getParam('ath', false) === '1';

        if ($isParamPresent) {
            $applicationMode = $this->appState->getMode();
            $storeId = $this->storeManager->getStore()->getId();

            if ($applicationMode === AppState::MODE_DEVELOPER || $this->developerHelper->isDevAllowed($storeId)) {
                return true;
            }
        }

        return false;
    }
145085
protected function isAllowed() : bool
    {
        return $this->request->has('referral')
            && in_array($this->request->get('referral'), $this->allowedReferral);
    }
1046622
private function isCacheUpToDate()
    {
        if (!file_exists($this->cachedFile)) {
            return false;
        }

        $cacheTime  = filemtime($this->cachedFile);
        $configTime = max(filemtime($this->configPath), filemtime($this->envFile));

        return $cacheTime == $configTime;
    }
402069
private function _checkCacheDir()
    {
        if (!is_dir($this->getCachePath()) && !mkdir($this->getCachePath(), 0775, true)) {
            throw new \Exception('Unable to create cache directory ' . $this->getCachePath());
        } elseif (!is_writable($this->getCachePath())) {
            throw new \Exception($this->getCachePath() . ' must be readable and writeable');
        }
        return true;
    }
344026
private function checkCacheContentEvent($check_status = true)
    {
        // Checks if a service cache-control exists
        if (null === $this->cache_content) {
            return false;
        }

        // Checks if the target event is not a main contentset
        if (
            $this->object instanceof ContentSet
            && true === is_array($this->object->getPages())
            && 0 < $this->object->getPages()->count()
        ) {
            return false;
        }

        return true === $check_status ? $this->validator->isValid('cache_status', $this->object) : true;
    }
1214276
private function _cached_required()
    {
        $image_info = getimagesize($this->source_file);
        
        if (($this->url_params['w'] == $image_info[0]) and ($this->url_params['h'] == $image_info[1])) {
            $this->serve_default = TRUE;
            return FALSE;
        }
        
        return TRUE;
    }
760720
public function isAllowedToNotify()
    {
        if (!$this->changeSet || !isset($this->changeSet['mask'])) {
            return false;
        }
        if ('ROLE_ANONYMOUS' === $this->role->getName() || 'ROLE_USER' === $this->role->getName()) {
            return false;
        }

        $oldState = $this->changeSet['mask'][0];
        $newState = $this->changeSet['mask'][1];

        return 0 === $oldState % 2 && 1 === $newState % 2;
    }
355146
public function needsReload()
    {
        if ($this->reload) {
            return true;
        }

        // will reload tld list if timestamp of cache file is outdated
        if (time() - $this->tldList['timestamp'] > $this->cacheTime) {
            return true;
        }

        // will reload tld list if changes to Additional.php have been made
        if ($this->tldList['timestamp'] < filemtime(__DIR__ .'/Additional.php')) {
            return true;
        }

        return false;
    }
46253
public function isAllowedToNotify()
    {
        if (!$this->node->isPublished()) {
            return false;
        }

        return $this->showNotification($this->node, $this->node->isPublished());
    }
357120
public function canModify()
    {
        if ( ! $this->getEnabledList()
                    ->canModify() )
        {
            return false;
        }

        $modules = $this->getModuleManager()
                        ->getModules();

        if ( ! in_array( 'Grid\MultisitePlatform', $modules ) )
        {
            return true;
        }

        return in_array( 'Grid\MultisiteCentral', $modules );
    }
438153
public function actionReadAll()
    {
        $notificationsIds = Yii::$app->request->post('ids', []);

        foreach ($notificationsIds as $id) {
            $notification = $this->getNotification($id);

            $notification->seen = 1;
            $notification->save();
        }

        return true;
    }
861989
protected function _isDisabledFieldCache()
    {
        $class = get_class($this);
        if (isset(self::$_blDisableFieldCaching[$class]) && self::$_blDisableFieldCaching[$class]) {
            return true;
        }

        return false;
    }