Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE)
 {
     /** @var \Drupal\node\NodeInterface $object */
     $form_id = 'node_' . $object->bundle() . '_form';
     $result = EntityReportAccessManager::accessReport($object, $form_id, $account);
     return $return_as_object ? $result : $result->isAllowed();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE)
 {
     /** @var \Drupal\comment\CommentInterface $object */
     $node = $object->getCommentedEntity();
     $form_id = 'comment_' . $node->getEntityTypeId() . '_' . $node->bundle() . '_form';
     $result = EntityReportAccessManager::accessReport($object, $form_id, $account);
     return $return_as_object ? $result : $result->isAllowed();
 }