private function evaluateVersionTarget(
        Target\Version $version,
        APILimitationValue $value
    ): ?bool {
        // intentionally evaluate all conditions separately from the least to the most important
        $accessVote = self::ACCESS_ABSTAIN;

        // allow creating new drafts
        if ($version->newStatus === VersionInfo::STATUS_DRAFT) {
            $accessVote = self::ACCESS_GRANTED;
        }

        // ... unless there's a specific list of target translations
        if (!empty($version->allLanguageCodesList)) {
            $accessVote = $this->evaluateMatchingAnyLimitation(
                $version->allLanguageCodesList,
                $value->limitationValues
            );
        }

        // ... or there's an intent to update Version
        if (!empty($version->forUpdateLanguageCodesList) || null !== $version->forUpdateInitialLanguageCode) {
            if (!empty($version->forUpdateLanguageCodesList)) {
                $diff = array_diff($version->forUpdateLanguageCodesList, $value->limitationValues);
                $accessVote = empty($diff) ? self::ACCESS_GRANTED : self::ACCESS_DENIED;
            }

            if ($accessVote !== self::ACCESS_DENIED && null !== $version->forUpdateInitialLanguageCode) {
                $accessVote = in_array(
                    $version->forUpdateInitialLanguageCode,
                    $value->limitationValues
                )
                    ? self::ACCESS_GRANTED
                    : self::ACCESS_DENIED;
            }
        }

        return $accessVote;
    }
private function evaluateVersionTarget(
        Target\Version $version,
        APILimitationValue $value
    ): ?bool {
        // intentionally evaluate all conditions separately from the least to the most important
        $accessVote = self::ACCESS_ABSTAIN;

        // allow creating new drafts
        if ($version->newStatus === VersionInfo::STATUS_DRAFT) {
            $accessVote = self::ACCESS_GRANTED;
        }

        // ... unless there's a specific list of target translations
        if (!empty($version->allLanguageCodesList)) {
            $accessVote = $this->evaluateMatchingAnyLimitation(
                $version->allLanguageCodesList,
                $value->limitationValues
            );
        }

        // ... or there's an intent to update Version
        if (!empty($version->forUpdateLanguageCodesList) || null !== $version->forUpdateInitialLanguageCode) {
            if (!empty($version->forUpdateLanguageCodesList)) {
                $diff = array_diff($version->forUpdateLanguageCodesList, $value->limitationValues);
                $accessVote = empty($diff) ? self::ACCESS_GRANTED : self::ACCESS_DENIED;
            }

            if ($accessVote !== self::ACCESS_DENIED && null !== $version->forUpdateInitialLanguageCode) {
                $accessVote = in_array(
                    $version->forUpdateInitialLanguageCode,
                    $value->limitationValues
                )
                    ? self::ACCESS_GRANTED
                    : self::ACCESS_DENIED;
            }
        }

        return $accessVote;
    }
private function evaluateVersionTarget ( Target \ Version $ version , APILimitationValue $ value ) : ? bool { // intentionally evaluate all conditions separately from the least to the most important $ accessVote = self :: ACCESS_ABSTAIN ; // allow creating new drafts if ( $ version -> newStatus === VersionInfo :: STATUS_DRAFT ) { $ accessVote = self :: ACCESS_GRANTED ; } // ... unless there's a specific list of target translations if ( ! empty ( $ version -> allLanguageCodesList ) ) { $ accessVote = $ this -> evaluateMatchingAnyLimitation ( $ version -> allLanguageCodesList , $ value -> limitationValues ) ; } // ... or there's an intent to update Version if ( ! empty ( $ version -> forUpdateLanguageCodesList ) || null !== $ version -> forUpdateInitialLanguageCode ) { if ( ! empty ( $ version -> forUpdateLanguageCodesList ) ) { $ diff = array_diff ( $ version -> forUpdateLanguageCodesList , $ value -> limitationValues ) ; $ accessVote = empty ( $ diff ) ? self :: ACCESS_GRANTED : self :: ACCESS_DENIED ; } if ( $ accessVote !== self :: ACCESS_DENIED && null !== $ version -> forUpdateInitialLanguageCode ) { $ accessVote = in_array ( $ version -> forUpdateInitialLanguageCode , $ value -> limitationValues ) ? self :: ACCESS_GRANTED : self :: ACCESS_DENIED ; } } return $ accessVote ; }
Evaluate permissions to create new Version.

@param \eZ\Publish\SPI\Limitation\Target\Version $version
@param \eZ\Publish\API\Repository\Values\User\Limitation $value

@return bool|null
Evaluate permissions to create new Version .