Add-case form counts as "case context"

This commit is contained in:
naomi 2018-05-13 12:46:17 +02:00
parent 85260daa0e
commit 20ab150226

View File

@ -23,7 +23,7 @@ class OCActorAccessControlHandler extends EntityAccessControlHandler {
/** @var \Drupal\opencase_entities\Entity\OCActorInterface $entity */ /** @var \Drupal\opencase_entities\Entity\OCActorInterface $entity */
$bundle = $entity->bundle(); $bundle = $entity->bundle();
$route_name = \Drupal::routeMatch()->getRouteName(); $route_name = \Drupal::routeMatch()->getRouteName();
$case_routes = ['entity.oc_case.canonical', 'entity.oc_case.edit_form', 'view.cases.page_1']; $case_routes = ['entity.oc_case.canonical', 'entity.oc_case.edit_form', 'view.cases.page_1', 'entity.oc_case.add_form'];
$is_case_context = in_array($route_name, $case_routes); $is_case_context = in_array($route_name, $case_routes);
switch ($operation) { switch ($operation) {