currentUser = $current_user; $this->tempStoreFactory = $temp_store_factory; parent::__construct($configuration, $plugin_id, $plugin_definition); } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('tempstore.private'), $container->get('current_user') ); } /** * {@inheritdoc} */ public function executeMultiple(array $entities) { $this->tempStoreFactory->get('user_user_operations_cancel')->set($this->currentUser->id(), $entities); } /** * {@inheritdoc} */ public function execute($object = NULL) { $this->executeMultiple([$object]); } /** * {@inheritdoc} */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\user\UserInterface $object */ return $object->access('delete', $account, $return_as_object); } }