Skip to content
Snippets Groups Projects
Commit fdf674a4 authored by catch's avatar catch
Browse files

Issue #3179850 by claudiu.cristea: EntityTestAccessControlHandler allows...

Issue #3179850 by claudiu.cristea: EntityTestAccessControlHandler allows viewing an unpublished entity

(cherry picked from commit 7de47b04)
parent 0e408ae8
No related branches found
No related tags found
6 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber,!3603#ISSUE 3346218 Add a different message on edit comment,!3555Issue #2473873: Views entity operations lack cacheability support, resulting in incorrect dropbuttons
......@@ -55,6 +55,9 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter
return AccessResult::allowedIfHasPermission($account, 'view test entity translations');
}
}
if ($entity instanceof EntityPublishedInterface && !$entity->isPublished()) {
return AccessResult::neutral('Unpublished entity');
}
return AccessResult::allowedIfHasPermission($account, 'view test entity');
}
elseif (in_array($operation, ['update', 'delete'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment