/** * {@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(); }
/** * {@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(); }