public function getAllowedTransitions(AccountInterface $account, Site $site)
    {
        $ret = [];
        $states = SiteState::getList();
        $matrix = $this->getStateTransitionMatrix();
        $drupalRoles = $account->getRoles();

        foreach ($states as $state => $name) {
            if (isset($matrix[$site->state][$state])) {
                foreach ($matrix[$site->state][$state] as $target) {
                    list($type, $role) = explode(':', $target, 2);
                    if ('site' === $type) {
                        if ($this->userHasRole($account, $site, $role)) {
                            $ret[$state] = $name;
                            break;
                        }
                    } else if ('drupal' === $type) {
                        if (in_array($role, $drupalRoles)) {
                            $ret[$state] = $name;
                            break;
                        }
                    }
                }
            }
        }

        return $ret;
    }
public function getAllowedTransitions(AccountInterface $account, Site $site)
    {
        $ret = [];
        $states = SiteState::getList();
        $matrix = $this->getStateTransitionMatrix();
        $drupalRoles = $account->getRoles();

        foreach ($states as $state => $name) {
            if (isset($matrix[$site->state][$state])) {
                foreach ($matrix[$site->state][$state] as $target) {
                    list($type, $role) = explode(':', $target, 2);
                    if ('site' === $type) {
                        if ($this->userHasRole($account, $site, $role)) {
                            $ret[$state] = $name;
                            break;
                        }
                    } else if ('drupal' === $type) {
                        if (in_array($role, $drupalRoles)) {
                            $ret[$state] = $name;
                            break;
                        }
                    }
                }
            }
        }

        return $ret;
    }
public function getAllowedTransitions ( AccountInterface $ account , Site $ site ) { $ ret = [ ] ; $ states = SiteState :: getList ( ) ; $ matrix = $ this -> getStateTransitionMatrix ( ) ; $ drupalRoles = $ account -> getRoles ( ) ; foreach ( $ states as $ state => $ name ) { if ( isset ( $ matrix [ $ site -> state ] [ $ state ] ) ) { foreach ( $ matrix [ $ site -> state ] [ $ state ] as $ target ) { list ( $ type , $ role ) = explode ( ':' , $ target , 2 ) ; if ( 'site' === $ type ) { if ( $ this -> userHasRole ( $ account , $ site , $ role ) ) { $ ret [ $ state ] = $ name ; break ; } } else if ( 'drupal' === $ type ) { if ( in_array ( $ role , $ drupalRoles ) ) { $ ret [ $ state ] = $ name ; break ; } } } } } return $ ret ; }
Get allow transition list for the given site and user

@param AccountInterface $account
@param Site $site

@return string[]
Keys are state identifiers and values are states names
Get allow transition list for the given site and user