WebformSubmissionLockAction.php in Webform 6.x
File
src/Plugin/Action/WebformSubmissionLockAction.php
View source
<?php
namespace Drupal\webform\Plugin\Action;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Session\AccountInterface;
class WebformSubmissionLockAction extends ActionBase {
public function execute($entity = NULL) {
$entity
->setLocked(TRUE)
->save();
}
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
$result = $object->locked
->access('edit', $account, TRUE)
->andIf($object
->access('update', $account, TRUE));
return $return_as_object ? $result : $result
->isAllowed();
}
}