Returns true if user forces to display plain template or
if private sales switched ON and user is not logged in

@return bool
345612
public function showPlainTemplate()
    {
        $blPlain = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('plain');
        if ($blPlain === false) {
            $oUser = $this->getUser();
            if ($this->isEnabledPrivateSales() &&
                (!$oUser || ($oUser && !$oUser->isTermsAccepted()))
            ) {
                $blPlain = true;
            }
        }

        return (bool) $blPlain;
    }
431624
public function enabled() : bool
    {
        if ($this->isEnabled !== null) {
            return $this->isEnabled;
        }

        if (!$this->config->get("antispam.{$this->instanceType}.enabled", true)) {
            return $this->isEnabled = false;
        }

        $disabledEnv = (array) $this->config->get("antispam.{$this->instanceType}.disabled_env", []);

        if (in_array($this->config->get('app.env', 'production'), $disabledEnv)) {
            return $this->isEnabled = false;
        }

        if ($this->instanceType === 'recaptcha') {
            if ($this->config->get('antispam.recaptcha.guests_only', false) && $this->request->user() !== null) {
                return $this->isEnabled = false;
            }
        }

        return $this->isEnabled = true;
    }
1036721
protected function _isSortEnabled()
    {
        if (!isset($this->controller->sortFields)) {
            return false;
        }

        foreach ($this->controller->sortFields as $field) {
            if (isset($field['actions']) &&
                is_array($field['actions']) &&
                in_array($this->action, $field['actions'])
            ) {
                return true;
            }
        }

        return false;
    }
776616
public function IsValidForCurrentUser()
    {
        $bIsValidForUser = false;
        $bIsValidShippingCountry = false;
        $bIsValidBillingCountry = false;

        $oUser = TdbDataExtranetUser::GetInstance();
        $bIsValidGroup = $this->checkUserGroup($oUser);
        if ($bIsValidGroup) {
            $bIsValidForUser = $this->checkUser($oUser);
        }
        if ($bIsValidForUser && $bIsValidGroup) {
            $bIsValidShippingCountry = $this->checkUserShippingCountry($oUser);
        }
        if ($bIsValidForUser && $bIsValidGroup && $bIsValidShippingCountry) {
            $bIsValidBillingCountry = $this->checkUserBillingCountry($oUser);
        }

        return $bIsValidForUser && $bIsValidGroup && $bIsValidShippingCountry && $bIsValidBillingCountry;
    }
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;
    }
515740
public function isGuestAllowed()
    {
        if (null === $user = $this['repo.users']->findByLogin(User::USER_GUEST)) {
            return false;
        }

        return count($this->getAclForUser($user)->get_granted_base()) > 0;
    }
1036277
public function enabled() {
    $config = $this->config->get('social_lets_connect_usage.settings');
    $usage_data_settings = $config->get('usage_data');

    $plugin_definition = $this->getPluginDefinition();
    if (in_array($plugin_definition['setting'], $usage_data_settings)) {
      return TRUE;
    }
    return FALSE;
  }
650725
public function canAccess()
    {
        // Admin can access everything, no point in checking.
        $member = Security::getCurrentUser();
        if ($member
            && (Permission::checkMember($member, [
                'ADMIN', // Full administrative rights
                'CMS_ACCESS_LeftAndMain', // Access to all CMS sections
                'CMS_ACCESS_CMSMain', // Access to CMS controllers
            ]))
        ) {
            return true;
        }

        // Check if we have access to current section on the current subsite.
        $accessibleSites = $this->owner->sectionSites(true, 'Main site', $member);
        return $accessibleSites->count() && $accessibleSites->find('ID', SubsiteState::singleton()->getSubsiteId());
    }
886951
private function isEnabled()
    {
        if (!$this->enabled) {
            return false;
        }

        if ($this->authorizationChecker) {
            foreach ($this->trustedRoles as $trustedRole) {
                if ($this->authorizationChecker->isGranted($trustedRole)) {
                    return false;
                }
            }
        }

        return true;
    }
702570
public function isDeletable()
    {
        $user = $this->getAuthenticatedUser();

        if ( empty( $user ) )
        {
            return false;
        }

        $root = $this->getRootParagraph();

        return ! empty( $root->editUsers ) && in_array( $user->id, $root->editUsers )
            || ! empty( $root->editGroups ) && in_array( $user->groupId, $root->editGroups )
            || $this->getServiceLocator()
                    ->get( 'Grid\User\Model\Permissions\Model' )
                    ->isAllowed( $root, $this->id == $this->rootId ? 'delete' : 'edit' );
    }
207573
protected function IsAllowedToShowRegisterAfterShoppingPage()
    {
        $oStep = TdbShopOrderStep::GetStep('thankyou');
        $bUserIsValid = false;
        if (!is_null($oStep)) {
            $oUser = $oStep->GetLastUserBoughtFromSession();
            if (!is_null($oUser)) {
                $bUserIsValid = $this->ValidateGivenUserData($oUser);
                if ($bUserIsValid) {
                    $oUserOrder = &TShopBasket::GetLastCreatedOrder();
                    if ($oUser->LoginExists()) {
                        $bUserIsValid = false;
                    }
                    if (is_null($oUserOrder)) {
                        $bUserIsValid = false;
                    }
                }
            }
        }

        return $bUserIsValid;
    }
148583
public function is_locked() {
        // If the setting is locked or the dependent setting should be locked then return true.
        if ($this->setting->get_status() !== base_setting::NOT_LOCKED ||
                $this->evaluate_disabled_condition($this->setting->get_value())) {
            return true;
        }
        // Else the dependent setting is not locked by this setting_dependency.
        return false;
    }
1051129
protected function _isPriceViewModeNetto()
    {
        $blResult = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowNetPrice');
        $oUser = $this->getArticleUser();
        if ($oUser) {
            $blResult = $oUser->isPriceViewModeNetto();
        }

        return $blResult;
    }
1063109
public function isBlocked()
    {
        if ($this->user() === null) {
            return null;
        }

        // Check user blocking status only if User model is role based user
        if ($this->user instanceof User) {
            return $this->user->blocked;
        }

        return false;
    }
983138
public function isDisplayable() {
        $displayable = $this->enable && $this->visible;
        if (true === $displayable) {
            return true;
        }
        foreach ($this->getNodes() as $current) {
            if (false === ($current instanceof AbstractNavigationNode)) {
                continue;
            }
            if (true === $current->isDisplayable()) {
                return true;
            }
        }
        return $displayable;
    }
592710
protected function _isPaginationEnabled()
    {
        if (!isset($this->controller->limits) ||
            !isset($this->controller->limits[$this->action]) ||
            !isset($this->controller->limits[$this->action]['default']) ||
            !isset($this->controller->limits[$this->action]['limits'])
        ) {
            return false;
        }

        return true;
    }
716741
protected function canAccess()
    {
        if ($this->formRequest->user()->isAdmin() || $this->formRequest->user()->isUser()) {
            return true;
        }

        return $this->formRequest->user()->canDo('message.message.view');
    }