public function PathFieldItemList::defaultAccess in Drupal 10
Same name and namespace in other branches
- 8 core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php \Drupal\path\Plugin\Field\FieldType\PathFieldItemList::defaultAccess()
- 9 core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php \Drupal\path\Plugin\Field\FieldType\PathFieldItemList::defaultAccess()
Contains the default access logic of this field.
See \Drupal\Core\Entity\EntityAccessControlHandlerInterface::fieldAccess() for the parameter documentation.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
Overrides FieldItemList::defaultAccess
File
- core/
modules/ path/ src/ Plugin/ Field/ FieldType/ PathFieldItemList.php, line 47
Class
- PathFieldItemList
- Represents a configurable entity path field.
Namespace
Drupal\path\Plugin\Field\FieldTypeCode
public function defaultAccess($operation = 'view', AccountInterface $account = NULL) {
if ($operation == 'view') {
return AccessResult::allowed();
}
return AccessResult::allowedIfHasPermissions($account, [
'create url aliases',
'administer url aliases',
], 'OR')
->cachePerPermissions();
}