protected function ScheduledTransitionRevisionLinkField::checkUrlAccess in Scheduled Transitions 8
Checks access to the link route.
Parameters
\Drupal\views\ResultRow $row: A view result row.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
Overrides LinkBase::checkUrlAccess
File
- src/
Plugin/ views/ field/ ScheduledTransitionRevisionLinkField.php, line 65
Class
- ScheduledTransitionRevisionLinkField
- Link to the scheduled revision.
Namespace
Drupal\scheduled_transitions\Plugin\views\fieldCode
protected function checkUrlAccess(ResultRow $row) {
/** @var \Drupal\scheduled_transitions\Entity\ScheduledTransitionInterface $scheduledTransition */
$scheduledTransition = $this
->getEntity($row);
$entity = $scheduledTransition
->getEntity();
if (!$entity || !$entity
->getEntityType()
->hasLinkTemplate('revision')) {
return AccessResult::neutral('Entity does not have a revision/canonical template.');
}
return parent::checkUrlAccess($row);
}