Skip to content

Commit

Permalink
Merge branch '2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed May 27, 2020
2 parents 995eda4 + 189e632 commit 609d373
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/UI/Value/ValueFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use eZ\Publish\API\Repository\Values\User\Policy;
use eZ\Publish\API\Repository\Values\User\RoleAssignment;
use eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface;
use eZ\Publish\SPI\Limitation\Target\Builder\VersionBuilder;
use EzSystems\EzPlatformAdminUi\Specification\UserExists;
use EzSystems\EzPlatformAdminUi\UI\Dataset\DatasetFactory;
use EzSystems\EzPlatformAdminUi\UI\Service\PathService;
Expand Down Expand Up @@ -141,8 +142,10 @@ public function createVersionInfo(VersionInfo $versionInfo): UIValue\Content\Ver
*/
public function createLanguage(Language $language, VersionInfo $versionInfo): UIValue\Content\Language
{
$target = (new VersionBuilder())->translateToAnyLanguageOf([$language->languageCode])->build();

return new UIValue\Content\Language($language, [
'userCanRemove' => $this->permissionResolver->canUser('content', 'remove', $versionInfo),
'userCanRemove' => $this->permissionResolver->canUser('content', 'remove', $versionInfo, [$target]),
'userCanEdit' => $this->permissionResolver->canUser('content', 'edit', $versionInfo),
'main' => $language->languageCode === $versionInfo->getContentInfo()->mainLanguageCode,
]);
Expand Down

0 comments on commit 609d373

Please # to comment.