Indicates whether the role instance is running in the Windows Azure
environment.

@static

@return bool
501332
public static function isAvailable()
    {
        try {
            self::_initialize();
        } catch (RoleEnvironmentNotAvailableException $ex) {
            return false;
        } catch (ChannelNotAvailableException $ex) {
            return false;
        }

        return self::$_runtimeClient != null;
    }
388219
public function hasRole($role = "general")
	{
        $roleModel = new \erdiko\users\models\Role;
        $roleEntity = $roleModel->findByName($role);
        if (empty($roleEntity)) {
            throw  new \Exception("Error, role {$role} not found.");
        }
        $result = $this->_user->getRole() == $roleEntity->getId();

		return $result;
	}
92539
public function isAdminArea()
    {
        if ($this->isGeneratedCollection()) {
            $pos = strpos($this->getCollectionFilename(), '/'.DIRNAME_DASHBOARD);

            return ($pos > -1);
        }

        return false;
    }
330039
protected function _checkRole() {
        if (in_array($this->_role, array_map('trim', explode(',', $this->request->access))) || $this->request->access == '*') {
            return true;
        }
        else {
            return false;
        }
    }
430252
public function isActive()
    {
        return $this->exists &&
                isset($this->_gemsData['gap_status']) &&
                $this->agenda->isStatusActive($this->_gemsData['gap_status']);
    }
307807
public function isUserAllowedAccess()
    {
        if (!is_object($this->accessControl)) {
            $this->accessControl = new AccessControl($this->user, $this->config->get('AccessControl', false));
        }

        $isAccessAllowed = $this->accessControl->isUserAllowedAccess();
        if (!$isAccessAllowed) {
            $this->eventManager()->fire(SecurityEvent::ROLE_INVALID, new SecurityEvent($this->user));
        }

        return $isAccessAllowed;
    }
159390
public function hasRole($role): bool
    {
        $slug = str_slug($role);

        return (bool) $this->roles->where('slug', $slug)->count();
    }
667762
public function userHasRole(string $role): bool
    {
        $user = $this->getUser();
        
        if($user->hasRole($role))
            return true;
        
        if (null === $userRoles = $user->getRoles())
            return false;
        
        foreach ($userRoles as $userRole) {
            try {
                if(\in_array($role, $this->getRoles($userRole)))
                    return true;                
            } catch (UndefinedRoleException $e) {
                continue;
            }
        }
        
        return false;
    }
290909
public function getAllAvailableRoles ()
    {
        return array_filter(
            $this->roleCollection,
            function (BaseRole $role)
            {
                if ($role instanceof Role)
                {
                    return !$role->isHidden();
                }

                //remove all BaseRoles
                return false;
            }
        );
    }
1145347
private boolean hasRole(CmsRole role) {

        if (m_user != null) {
            return OpenCms.getRoleManager().hasRole(m_cms, m_user.getName(), CmsRole.VFS_MANAGER);
        }
        return false;
    }
505375
public function isEngineRunning()
    {
        foreach (array_keys($this->getServices()) as $name) {
            $container = $this->getServiceContainerId($name);
            if (!$this->isContainerRunning($container)) {
                return false;
            }
        }

        return true;
    }
437167
public function inRole($role): bool
    {
        $role = Arr::first($this->roles, function ($instance) use ($role) {
            if ($role instanceof RoleInterface) {
                return $instance->getRoleId() === $role->getRoleId();
            }
            if ($instance->getRoleId() === $role || $instance->getRoleSlug() === $role) {
                return true;
            }

            return false;
        });

        return $role !== null;
    }
596685
public function hasChildren()
    {
        if ($this->resources === null) {
            $this->initializeResouces();
        }

        return current($this->resources) instanceof \Arbit\VCSWrapper\Directory;
    }
853766
public function isAdmin(): bool
    {
        return $this->isLoggedIn()
            && isset($this->session->get('user')['admin'])
            && $this->session->get('user')['admin'] === true;
    }
26449
public function isEnabled()
    {
        if (null !== $this->getRequireRouteName())
        {
            if ($this->getInvertRequireRouteName() XOR ($this->getCurrentRouteName() != $this->getRequireRouteName()))
            {
                return false;
            }
        }

        return $this->enabledIfRoleMissing || $this->userHasRequiredRole();
    }
1140283
public function isCorpCharacterWithRoles(): bool
    {

        // Check the role needed for this call. The minimum role would
        // be configured in the roles attribute, but we will add the
        // 'Director' role as directors automatically have all roles.
        array_push($this->roles, 'Director');

        // Perform the check.
        if (in_array($this->scope, $this->token->scopes) && ! empty(
            array_intersect($this->roles, $this->getCharacterRoles()))) {

            return true;
        }

        // Considering a corporation role was required with the scope,
        // fail the authentication check. If we don't fail here, simply
        // granting the SSO scope would pass the next truth test.
        return false;
    }
956769
public function hasUserRoles($roles)
	{
		if ($this->session_machine === null) {
			throw new RuntimeException('Session machine not ready ‒ '.__METHOD__.' called too soon.');
		}

		if (is_array($roles)) {
			return count(array_intersect($this->getUserRoles(), $roles)) > 0;
		} else {
			return in_array($roles, $this->getUserRoles());
		}
	}