Skip to content
Snippets Groups Projects
Commit fcc1c7ae authored by dpi's avatar dpi
Browse files

Remove reference to deprecated isTemplate method.

parent dcb7a8b3
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ use Drupal\Core\Entity\EntityInterface; ...@@ -5,6 +5,7 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResult;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\courier\ChannelInterface;
use Drupal\rng\Entity\RuleSchedule; use Drupal\rng\Entity\RuleSchedule;
use Drupal\rng\Entity\Registrant; use Drupal\rng\Entity\Registrant;
use Drupal\rng\Exception\InvalidEventException; use Drupal\rng\Exception\InvalidEventException;
...@@ -43,10 +44,7 @@ function rng_entity_access(EntityInterface $entity, $operation, AccountInterface ...@@ -43,10 +44,7 @@ function rng_entity_access(EntityInterface $entity, $operation, AccountInterface
} }
if ($operation == 'update') { if ($operation == 'update') {
/** @var \Drupal\courier\IdentityChannelManagerInterface $identity_channel_manager */ if ($entity instanceof ChannelInterface) {
$identity_channel_manager = \Drupal::service('plugin.manager.identity_channel');
if ($identity_channel_manager->isTemplate($entity)) {
/** @var $entity \Drupal\courier\ChannelInterface */
if ($template_collection = TemplateCollection::getTemplateCollectionForTemplate($entity)) { if ($template_collection = TemplateCollection::getTemplateCollectionForTemplate($entity)) {
// Allow editing template if the user has 'manage event' for the event. // Allow editing template if the user has 'manage event' for the event.
return AccessResult::allowedIf(($owner = $template_collection->getOwner()) && $owner->access('manage event')) return AccessResult::allowedIf(($owner = $template_collection->getOwner()) && $owner->access('manage event'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment