diff --git a/contao/dca/tl_page.php b/contao/dca/tl_page.php index caa2f79..d1e02c2 100755 --- a/contao/dca/tl_page.php +++ b/contao/dca/tl_page.php @@ -1,4 +1,5 @@ |null */ @@ -42,10 +46,11 @@ class MissingLanguageIconListener implements ResetInterface */ private ?array $translationCache = null; - public function __construct(TokenStorageInterface $tokenStorage, Connection $connection) + public function __construct(TokenStorageInterface $tokenStorage, Connection $connection, AuthorizationCheckerInterface $authorizationChecker) { $this->tokenStorage = $tokenStorage; $this->connection = $connection; + $this->authorizationChecker = $authorizationChecker; } /** @@ -83,7 +88,12 @@ private function onPageLabel(array $args, $previousResult = null): string $label = $previousResult; } - if ('root' === $row['type'] || 'folder' === $row['type'] || 'page' !== Input::get('do')) { + if ( + 'root' === $row['type'] + || 'folder' === $row['type'] + || 'page' !== Input::get('do') + || !$this->authorizationChecker->isGranted(ContaoCorePermissions::USER_CAN_EDIT_FIELD_OF_TABLE, 'tl_page.languageMain') + ) { return $label; } @@ -129,7 +139,10 @@ private function onArticleLabel(array $args, $previousResult = null): string $label = $previousResult; } - if (!$row['showTeaser']) { + if ( + !$row['showTeaser'] + || !$this->authorizationChecker->isGranted(ContaoCorePermissions::USER_CAN_EDIT_FIELD_OF_TABLE, 'tl_article.languageMain') + ) { return $label; } @@ -155,6 +168,10 @@ private function onNewsChildRecords(array $args, $previousResult = null): string $label = '