Returns true if guest access is allowed.

@return boolean
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;
    }
1019323
protected function canAccess()
    {
        $replacingFile = $this->getReplacingFile();
        if ($replacingFile === null) {
            return false;
        }
        $replacingFilePermissions = new Checker($replacingFile);

        return $replacingFilePermissions->canEditFileContents();
    }
578275
public function canAdmin()
    {
        $component = $this->getIdentifier()->package;

        return $this->getObject('user')->authorise('core.admin', 'com_'.$component) === true;
    }
235269
public function hasEnabledInvitationRegistration()
    {
        if ($this->invitationRegistrationClass === false || !is_string($this->invitationRegistrationClass) || !class_exists($this->invitationRegistrationClass)) {
            return false;
        }
        return true;
    }
1288860
public function check_capabilities() {
		if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
			return false;
		}

		if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
			return false;
		}

		return true;
	}
1213900
public function is_review_allowed() {
        if (!$this->has_capability('mod/quiz:viewreports')) {
            return false;
        }

        $cm = $this->get_cm();
        if ($this->has_capability('moodle/site:accessallgroups') ||
                groups_get_activity_groupmode($cm) != SEPARATEGROUPS) {
            return true;
        }

        // Check the users have at least one group in common.
        $teachersgroups = groups_get_activity_allowed_groups($cm);
        $studentsgroups = groups_get_all_groups(
                $cm->course, $this->attempt->userid, $cm->groupingid);
        return $teachersgroups && $studentsgroups &&
                array_intersect(array_keys($teachersgroups), array_keys($studentsgroups));
    }
853766
public function isAdmin(): bool
    {
        return $this->isLoggedIn()
            && isset($this->session->get('user')['admin'])
            && $this->session->get('user')['admin'] === true;
    }
936416
public function isIpAllowed()
    {
        if ($ipString = $this->getConfigValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_IP_RESTRICTION_ADDRESSES,
            'default'
        )
        ) {
            //string to array
            $ipArray = explode(',', $ipString);

            //remove white spaces
            foreach ($ipArray as $key => $ip) {
                $ipArray[$key] = trim($ip);
            }

            //ip address
            $ipAddress = $this->_remoteAddress->getRemoteAddress();

            if (in_array($ipAddress, $ipArray)) {
                return true;
            }
        } else {
            //empty ip list from configuration will ignore the validation
            return true;
        }

        $this->log(sprintf("Failed to authenticate IP address - %s", $ipAddress));

        return false;
    }
1278482
public function isAvailable()
    {
        if (!empty($this->adapter)) {
            // adapter is already etablished
            return true;
        }
        $user = $this->getUser();
        $sessionDataStored = $user->getAuthSession($this->providerKey);
        if (empty($sessionDataStored)) {
            // for this user no session has been stored
            return false;
        }
        $hybridAuth = $this->getHybridAuth();
        $hybridAuth->restoreSessionData($sessionDataStored);
        if ($hybridAuth->isConnectedWith($this->providerKey)) {
            return true;
        }
        return false;
    }
700023
public static function hasUser()
    {

        if (!(Yii::$app instanceof Application)) {
            return false;
        }
        if (!Yii::$app->db->getTableSchema(User::tableName())) {
            return false;
        }
        try {
            $identityClass = Yii::$app->user->identityClass;
        } catch (\Exception $e) {
            $identityClass = false;
        }

        if (!$identityClass) {
            return false;
        }

        return !Yii::$app->user->isGuest;
    }
1110575
protected function canModerate()
    {
        $user = $this->getUser();

        if ($user->name == 'Guest' && $user->email == 'guest@example.com') {
            return false;
        }

        if (method_exists($user, 'can')) {
            return $user->can('forum-moderate');
        }

        // If no method of authorizing return false;
        return false;
    }
808190
protected function hasAccess()
    {
        return $this->module->password == Yii::$app->session->get(self::STYLEGUIDE_SESSION_PWNAME, false);
    }
1369991
public function checkAccess($p = P, $do = P_DO, $user_id = 0)
    {
        // Guest module can be opened by anyone
        if ($p === 'guest') {
            return true;
        }

        // Only logged-in Users can proceed further
        if (!$this->isLogged()) {
            return false;
        }

        // Get User id
        if (!$user_id) {
            $user_id = USER_ID;
        }

        // Check maybe User have group with full access
        $group_id = $this->getUserData('group_id', $user_id);
        if (self::getInstance()->getGroupData('full_access', $group_id)) {
            return true;
        }

        // Check or init cache
        if (!self::$access) {
            $group_access_collection = new GroupAccessRepository();
            $group_access_collection->setWhereGroupId((int)$group_id);
            foreach ($group_access_collection->getAsArrayOfObjectData() as $group_access) {
                /** @var GroupAccess $group_access */
                self::$access[$group_access['p']][$group_access['do']] = true;
            }
        }

        // Check access for exact admin panel page and action
        return isset(self::$access[$p][$do]);
    }
1353919
protected function _authorize()
	{
		// Check if they are logged in
		if ($this->juser->isGuest())
		{
			return false;
		}

		if ($this->juser->authorise('core.admin', $this->_option))
		{
			return true;
		}

		return false;
	}
1024615
static public function isSysCompanyUser(){
         if(Yii::app()->user->isGuest){
             return FALSE;
         }
         $a = self::getRoles();
         return isset($a[self::RoleSysCompanyUser]);
     }
154606
private function __canAccessAlerts()
    {
        if ($this->Page instanceof AdministrationPage && self::isLoggedIn() && Symphony::Author()->isDeveloper()) {
            return true;
        }

        return false;
    }
275862
public static function check() {
		if (R::count("permission") < 1) {
			$role       = R::dispense("permission");
			$role->name = "guest";
			R::store($role);
		}
	}