function SaveAction::access
Overrides ActionInterface::access
File
-
core/
lib/ Drupal/ Core/ Action/ Plugin/ Action/ SaveAction.php, line 72
Class
- SaveAction
- Provides an action that can save any entity.
Namespace
Drupal\Core\Action\Plugin\ActionCode
public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
// It's not necessary to check the changed field access here, because
// Drupal\Core\Field\ChangedFieldItemList would anyway return 'not allowed'.
// Also changing the changed field value is only a workaround to trigger an
// entity resave. Without a field change, this would not be possible.
/** @var \Drupal\Core\Entity\EntityInterface $object */
return $object->access('update', $account, $return_as_object);
}