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;
    }