Return whether the component is active for actor. A component is active, if
it has been assigned as awlays for the actor type or it has been enabled for the
actor.

@param ComActorsDomainEntityActor $actor The actor object

@return bool
420283
public function activeForActor($actor)
    {
        $actortype = $actor->getEntityDescription()->getInheritanceColumnValue()->getIdentifier();

        $access = $this->getAssignmentForIdentifier($actortype);

        $return = false;

        if ($access == self::ACCESS_ALWAYS) {
            $return = true;
        } elseif ($access == self::ACCESS_OPTIONAL) {
            $return = $this->enabledForActor($actor);
        }

        return $return;
    }
373849
public function allows(ActorInterface $actor, string $permission, array $context): bool
    {
        $parameters = compact('actor', 'permission', 'context') + $context;

        //Mounting aliases
        foreach (static::ALIASES as $target => $alias) {
            $parameters[$target] = $parameters[$alias];
        }

        try {
            $method = new \ReflectionMethod($this, static::CHECK_METHOD);
            $method->setAccessible(true);
        } catch (\ReflectionException $e) {
            throw new RuleException($e->getMessage(), $e->getCode(), $e);
        }

        try {
            return $method->invokeArgs($this, $this->resolver->resolveArguments($method, $parameters));
        } catch (\Throwable $e) {
            throw new RuleException(sprintf("[%s] %s", get_class($this), $e->getMessage()), $e->getCode(), $e);
        }
    }
438999
public function canExecute($action)
    {
        if ($this->getItem() && $this->getItem()->blocking(get_viewer())) {
            return false;
        }

        //if the action is an admin action then check if the viewer is an admin
        if ($this->isAdministrable()) {
            $methods = $this->getBehavior('administrable')->getMethods();

            if (in_array('_action'.ucfirst($action), $methods) && $this->canAdminister() === false) {
                return false;
            }
        }

        return parent::canExecute($action);
    }
140871
public function isCurrentUserOwner(Transaction $transaction)
    {
        if($this->securityContext->getToken()->getUser()->isGranted('ROLE_ADMIN')){
            return true;
        }
        
        $currentUserId = $this->securityContext->getToken()->getUser()->getId();
        //actor owner
        if($transaction->getActor() instanceof Actor){
            if($currentUserId ==  $transaction->getActor()->getId()){
                return true;
            }elseif($currentUserId == $transaction->getItems()->first()->getProduct()->getActor()->getId()){
                return true;
            }
        }
        
        return false;
    }
1084938
public function isActive($active = true)
    {
        if (! is_bool($active)) {
            $active = false;
        }
        $this->isActive = $active;

        return $this;
    }
212190
protected function isActive($action)
    {
        $id = $this->getActionId($action);
        return !in_array($id, $this->except, true) && (empty($this->only) || in_array($id, $this->only, true));
    }
1126879
private function isParentModuleAssociation(Association $association) : bool
    {
        return in_array($this->getModelByAssociation($association), $this->getParentModules());
    }
808093
public function isActive(RolloutAbstract $rollout, DeterminableUserInterface $user = null)
    {
        
        if (100 === $this->getPercentage()) {
            return true;
        }
        
        if (!$user instanceof DeterminableUserInterface) {
            return false;
        }
        
        $userId = $user->getId();
        
        if (true === $this->isUserInPercentage($userId)
            || true === $this->isUserInActiveUsers($userId)
            || true === $this->isUserInActiveRole($user, $rollout)
            || true === $this->isUserInActiveGroup($user, $rollout)
        ) {
            return true;
        }
            
        
        return false;
    }
112792
public function fetchActor()
    {
        if ($entity = $this->getItem()) {
            $id = $entity->actorId;
            $actor = $this->getService('repos:people.person')->find(array('id' => $id));
            $this->actor = $actor;
        }
    }
606803
public function isAll($role)
    {
        foreach ($this->getArrayFrom($role) as $role) {
            if (!$this->hasRole($role)) {
                return false;
            }
        }

        return true;
    }
860340
protected function _isItemActive(array $item): bool
    {
        if (empty($item['url'])) {
            return false;
        }
        $current = $this->_currentUrl;
        if (!empty($item['url']['plugin']) && $item['url']['plugin'] != $current['plugin']) {
            return false;
        }
        if ($item['url']['controller'] == $current['controller'] && $item['url']['action'] == $current['action']) {
            $this->_controllerActive = $current['controller'];
            $this->_actionActive = $item['url']['action'];

            return true;
        }
        if (!empty($this->_actionActive) && $item['url']['controller'] == $current['controller']) {
            $this->_controllerActive = $current['controller'];

            return true;
        }

        return false;
    }
1280508
public function withAuthority(Actor $authority = null): self
    {
        $statement = clone $this;
        $statement->authority = $authority;

        return $statement;
    }
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;
    }
680464
def has_actor(self, aid):
        '''
        
        '''
        url = '%s://%s/%s' % (self.transport, self.host_url.netloc, aid)
        return url in self.actors.keys()
713737
public function getCommonLeaders($actor)
    {
        if (!isset($this->__common_leaders)) {
            $ids = array_intersect($this->leaderIds->toArray(), $actor->leaderIds->toArray());
            $ids[] = -1;
            $query = $this->getService('repos:actors.actor')->getQuery()->where('id', 'IN', $ids);

            $this->__common_leaders = $query->toEntitySet();
        }

        return $this->__common_leaders;
    }
632658
def is_active(self):
    
    if not self.multiplexer:
      return False

    if self._is_active:
      # We have already determined that the projector plugin should be active.
      # Do not re-compute that. We have no reason to later set this plugin to be
      # inactive.
      return True

    if self._thread_for_determining_is_active:
      # We are currently determining whether the plugin is active. Do not start
      # a separate thread.
      return self._is_active

    # The plugin is currently not active. The frontend might check again later.
    # For now, spin off a separate thread to determine whether the plugin is
    # active.
    new_thread = threading.Thread(
        target=self._determine_is_active,
        name='ProjectorPluginIsActiveThread')
    self._thread_for_determining_is_active = new_thread
    new_thread.start()
    return False
1173556
public function isInUse(AssetInterface $asset)
    {
        /** @var AssetUsageStrategyInterface $strategy */
        foreach ($this->getUsageStrategies() as $strategy) {
            if ($strategy->isInUse($asset) === true) {
                return true;
            }
        }

        return false;
    }