diff --git a/config/install/system.action.webform_submission_make_locked_action.yml b/config/install/system.action.webform_submission_make_locked_action.yml new file mode 100644 index 00000000..19f27bc6 --- /dev/null +++ b/config/install/system.action.webform_submission_make_locked_action.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: + module: + - webform +id: webform_submission_make_locked_action +label: 'Lock submission' +type: webform_submission +plugin: webform_submission_make_locked_action +configuration: { } diff --git a/config/install/system.action.webform_submission_make_unlocked_action.yml b/config/install/system.action.webform_submission_make_unlocked_action.yml new file mode 100644 index 00000000..422fa8fa --- /dev/null +++ b/config/install/system.action.webform_submission_make_unlocked_action.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: + module: + - webform +id: webform_submission_make_unlocked_action +label: 'Unlock submission' +type: webform_submission +plugin: webform_submission_make_unlocked_action +configuration: { } diff --git a/config/schema/webform.action.schema.yml b/config/schema/webform.action.schema.yml index 5fde3495..ec717247 100644 --- a/config/schema/webform.action.schema.yml +++ b/config/schema/webform.action.schema.yml @@ -9,3 +9,11 @@ action.configuration.webform_submission_make_sticky_action: action.configuration.webform_submission_make_unsticky_action: type: action_configuration_default label: 'Unstar/Unflag selected submission configuration' + +action.configuration.webform_submission_make_locked_action: + type: action_configuration_default + label: 'Lock selected submission configuration' + +action.configuration.webform_submission_make_unlocked_action: + type: action_configuration_default + label: 'Unlock selected submission configuration' diff --git a/config/schema/webform.plugin.handler.schema.yml b/config/schema/webform.plugin.handler.schema.yml index 3f9118a3..6291d5b5 100644 --- a/config/schema/webform.plugin.handler.schema.yml +++ b/config/schema/webform.plugin.handler.schema.yml @@ -15,6 +15,9 @@ webform.handler.action: notes: label: 'Notes' type: text + submissionlock: + label: 'Flag' + type: boolean sticky: label: 'Flag' type: boolean diff --git a/css/webform.admin.css b/css/webform.admin.css index ce0a8392..b834ee62 100644 --- a/css/webform.admin.css +++ b/css/webform.admin.css @@ -124,6 +124,28 @@ a:focus .webform-icon-notes--off { background-image: url(../images/icons/notes-link.svg); } +.webform-icon-lock--on { + background-image: url(../images/icons/lock.svg); +} + +.webform-icon-lock--off { + background-image: url(../images/icons/unlock.svg); +} + +.webform-icon-lock--link { + background-image: url(../images/icons/lock.svg); +} + +a:hover .webform-icon-lock--on, +a:focus .webform-icon-lock--on{ + background-image: url(../images/icons/lock.svg); +} + +a:hover .webform-icon-lock--off, +a:focus .webform-icon-lock--off { + background-image: url(../images/icons/unlock.svg); +} + .webform-icon-sticky { background: transparent url(../images/icons/sticky.svg) no-repeat left top; display: inline-block; diff --git a/images/icons/lock.svg b/images/icons/lock.svg new file mode 100644 index 00000000..12b16022 --- /dev/null +++ b/images/icons/lock.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/images/icons/unlock.svg b/images/icons/unlock.svg new file mode 100644 index 00000000..971eaf2d --- /dev/null +++ b/images/icons/unlock.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Controller/WebformSubmissionController.php b/src/Controller/WebformSubmissionController.php index 917e968f..821724e8 100644 --- a/src/Controller/WebformSubmissionController.php +++ b/src/Controller/WebformSubmissionController.php @@ -37,4 +37,31 @@ class WebformSubmissionController extends ControllerBase { return $response; } + /** + * Toggle webform submission lock. + * + * @param \Drupal\webform\WebformSubmissionInterface $webform_submission + * A webform submission. + * + * @return \Drupal\Core\Ajax\AjaxResponse + * An Ajax response that toggle the lock icon. + */ + public function lock(WebformSubmissionInterface $webform_submission) { + // Toggle lock. + if ($webform_submission->isLocked()){ + $webform_submission->unlock()->save(); + } else { + $webform_submission->lock()->save(); + } + + // Get state. + $state = $webform_submission->isLocked() ? 'on' : 'off'; + + $response = new AjaxResponse(); + $response->addCommand(new HtmlCommand( + '#webform-submission-' . $webform_submission->id() . '-lock', + new FormattableMarkup('', ['@state' => $state]) + )); + return $response; + } } diff --git a/src/Entity/WebformSubmission.php b/src/Entity/WebformSubmission.php index 193c2fcf..95cd766a 100644 --- a/src/Entity/WebformSubmission.php +++ b/src/Entity/WebformSubmission.php @@ -192,6 +192,11 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn ->setDescription(t('The ID of the entity of which this webform submission was submitted from.')) ->setSetting('max_length', 255); + $fields['submissionlock'] = BaseFieldDefinition::create('boolean') + ->setLabel(t('Lock')) + ->setDescription(t('A flag that indicates a locked webform submission.')) + ->setDefaultValue(FALSE); + $fields['sticky'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Sticky')) ->setDescription(t('A flag that indicate the status of the webform submission.')) @@ -284,6 +289,22 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn return $this; } + /** + * {@inheritdoc} + */ + public function lock() { + $this->set('submissionlock', true); + return $this; + } + + /** + * {@inheritdoc} + */ + public function unlock() { + $this->set('submissionlock', false); + return $this; + } + /** * {@inheritdoc} */ @@ -516,6 +537,20 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn return $this->get('completed')->value ? TRUE : FALSE; } + /** + * {@inheritdoc} + */ + public function isLocked() { + return $this->get('submissionlock')->value ? true : false; + } + + /** + * {@inheritdoc} + */ + public function isUnlocked() { + return $this->get('submissionlock')->value ? false : true; + } + /** * {@inheritdoc} */ @@ -543,6 +578,9 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn elseif ($this->isDraft()) { return self::STATE_DRAFT; } + elseif ($this->isLocked()) { + return self::STATE_LOCKED; + } elseif ($this->completed->value == $this->changed->value) { return self::STATE_COMPLETED; } @@ -579,8 +617,9 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn $duplicate->set('changed', NULL); $duplicate->set('completed', NULL); - // Clear admin notes and sticky. + // Clear admin notes, lock, and sticky. $duplicate->set('notes', ''); + $duplicate->set('submissionlock', FALSE); $duplicate->set('sticky', FALSE); return $duplicate; diff --git a/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php b/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php index 647788b2..d64695d1 100644 --- a/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php +++ b/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php @@ -111,7 +111,7 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm // @see \Drupal\webform\Form\WebformResultsCustomForm::buildForm $available_columns = $webform_submission_storage->getColumns($webform); // Remove columns that should never be displayed to users. - $available_columns = array_diff_key($available_columns, array_flip(['uuid', 'in_draft', 'entity', 'sticky', 'notes', 'uid', 'operations'])); + $available_columns = array_diff_key($available_columns, array_flip(['uuid', 'in_draft', 'entity', 'submissionlock', 'sticky', 'notes', 'uid', 'operations'])); $custom_columns = $webform_submission_storage->getUserColumns($webform); // Change sid's # to an actual label. $available_columns['sid']['title'] = $this->t('Submission ID'); @@ -259,7 +259,7 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm '#title' => $this->t('Total submissions limit interval'), '#default_value' => $settings['limit_total_interval'], '#states' => [ - 'visible' => [':input[name="limit_total"]' => ['!value' => '']], + 'visible' => [':input[name="limit_total"]' => ['filled' => TRUE]], ] ]; $form['submission_limits']['total']['entity_limit_total'] = [ @@ -274,7 +274,7 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm '#title' => $this->t('Total submissions limit interval per source entity'), '#default_value' => $settings['entity_limit_total_interval'], '#states' => [ - 'visible' => [':input[name="entity_limit_total"]' => ['!value' => '']], + 'visible' => [':input[name="entity_limit_total"]' => ['filled' => TRUE]], ] ]; $form['submission_limits']['total']['limit_total_message'] = [ @@ -284,9 +284,9 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm '#default_value' => $settings['limit_total_message'], '#states' => [ 'visible' => [ - [':input[name="limit_total"]' => ['!value' => '']], + [':input[name="limit_total"]' => ['filled' => TRUE]], 'or', - [':input[name="entity_limit_total"]' => ['!value' => '']], + [':input[name="entity_limit_total"]' => ['filled' => TRUE]], ], ], ]; @@ -307,7 +307,7 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm '#title' => $this->t('Per user submission limit interval'), '#default_value' => $settings['limit_user_interval'], '#states' => [ - 'visible' => [':input[name="limit_user"]' => ['!value' => '']], + 'visible' => [':input[name="limit_user"]' => ['filled' => TRUE]], ] ]; $form['submission_limits']['user']['entity_limit_user'] = [ @@ -322,7 +322,7 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm '#title' => $this->t('Per user submission limit interval per source entity'), '#default_value' => $settings['entity_limit_user_interval'], '#states' => [ - 'visible' => [':input[name="entity_limit_user"]' => ['!value' => '']], + 'visible' => [':input[name="entity_limit_user"]' => ['filled' => TRUE]], ] ]; $form['submission_limits']['user']['limit_user_message'] = [ @@ -331,9 +331,9 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm '#default_value' => $settings['limit_user_message'], '#states' => [ 'visible' => [ - [':input[name="limit_user"]' => ['!value' => '']], + [':input[name="limit_user"]' => ['filled' => TRUE]], 'or', - [':input[name="entity_limit_user"]' => ['!value' => '']], + [':input[name="entity_limit_user"]' => ['filled' => TRUE]], ], ], ]; diff --git a/src/Plugin/Action/LockWebformSubmission.php b/src/Plugin/Action/LockWebformSubmission.php new file mode 100644 index 00000000..779bd3b0 --- /dev/null +++ b/src/Plugin/Action/LockWebformSubmission.php @@ -0,0 +1,38 @@ +lock()->save(); + } + + /** + * {@inheritdoc} + */ + public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { + /** @var \Drupal\webform\WebformSubmissionInterface $object */ + $result = $object->lock->access('edit', $account, TRUE) + ->andIf($object->access('update', $account, TRUE)); + + return $return_as_object ? $result : $result->isAllowed(); + } + +} diff --git a/src/Plugin/Action/UnlockWebformSubmission.php b/src/Plugin/Action/UnlockWebformSubmission.php new file mode 100644 index 00000000..d18c7c59 --- /dev/null +++ b/src/Plugin/Action/UnlockWebformSubmission.php @@ -0,0 +1,38 @@ +unlock()->save(); + } + + /** + * {@inheritdoc} + */ + public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { + /** @var \Drupal\webform\WebformSubmissionInterface $object */ + $result = $object->lock->access('edit', $account, TRUE) + ->andIf($object->access('update', $account, TRUE)); + + return $return_as_object ? $result : $result->isAllowed(); + } + +} diff --git a/src/Tests/Exporter/WebformExporterOptionsTest.php b/src/Tests/Exporter/WebformExporterOptionsTest.php index 7677ae18..4f8f3393 100644 --- a/src/Tests/Exporter/WebformExporterOptionsTest.php +++ b/src/Tests/Exporter/WebformExporterOptionsTest.php @@ -33,7 +33,7 @@ class WebformExporterOptionsTest extends WebformTestBase { // Set default edit export settings. $edit = [ // Exclude all columns except sid. - 'excluded_columns' => 'serial,uuid,token,uri,created,completed,changed,in_draft,current_page,remote_addr,uid,langcode,webform_id,entity_type,entity_id,sticky,notes', + 'excluded_columns' => 'serial,uuid,token,uri,created,completed,changed,in_draft,current_page,remote_addr,uid,langcode,webform_id,entity_type,entity_id,submissionlock,sticky,notes', ]; // Check default options. diff --git a/src/WebformSubmissionAccessControlHandler.php b/src/WebformSubmissionAccessControlHandler.php index 87e58317..04e12448 100644 --- a/src/WebformSubmissionAccessControlHandler.php +++ b/src/WebformSubmissionAccessControlHandler.php @@ -25,34 +25,35 @@ class WebformSubmissionAccessControlHandler extends EntityAccessControlHandler { switch ($operation) { case 'view': // Allow users with 'view any webform submission' to view all submissions. - if ($account->hasPermission('view any webform submission')) { + if ($account->hasPermission('view any webform submission') && $entity->isUnlocked()) { return AccessResult::allowed(); } // Allow users with 'view own webform submission' to view own submission. - if ($account->hasPermission('view own webform submission') && $entity->getOwnerId() == $account->id()) { + if ($account->hasPermission('view own webform submission') && $entity->getOwnerId() == $account->id() && $entity->isUnlocked()) { return AccessResult::allowed(); } break; case 'update': // Allow users with 'edit any webform submission' to edit all submissions. - if ($account->hasPermission('edit any webform submission')) { + if ($account->hasPermission('edit any webform submission') && $entity->isUnlocked()) { return AccessResult::allowed(); } // Allow users with 'edit own webform submission' to edit own submission. - if ($account->hasPermission('edit own webform submission') && $entity->getOwnerId() == $account->id()) { + if ($account->hasPermission('edit own webform submission') && $entity->getOwnerId() == $account->id() && $entity->isUnlocked()) { return AccessResult::allowed(); } break; + case 'delete': - // Allow users with 'delete any webform submission' to edit all submissions. - if ($account->hasPermission('delete any webform submission')) { + // Allow users with 'delete any webform submission' to edit all submissions if unlocked. + if ($account->hasPermission('delete any webform submission') && $entity->isUnlocked()) { return AccessResult::allowed(); } - // Allow users with 'delete own webform submission' to edit own submission. - if ($account->hasPermission('delete own webform submission') && $entity->getOwnerId() == $account->id()) { + // Allow users with 'delete own webform submission' to edit own submission if unlocked. + if ($account->hasPermission('delete own webform submission') && $entity->getOwnerId() == $account->id() && $entity->isUnlocked()) { return AccessResult::allowed(); } break; @@ -60,11 +61,15 @@ class WebformSubmissionAccessControlHandler extends EntityAccessControlHandler { // Check webform update access. $webform = $entity->getWebform(); - if ($webform->checkAccessRules($operation, $account, $entity)) { + if ($webform->checkAccessRules($operation, $account, $entity) && $entity->isUnlocked()) { return AccessResult::allowed(); } - return parent::checkAccess($entity, $operation, $account); + if ($operation != 'view' && $operation != 'notes' && $entity->isLocked()) { + return AccessResult::forbidden(); + } else { + return parent::checkAccess($entity, $operation, $account); + } } } diff --git a/src/WebformSubmissionExporter.php b/src/WebformSubmissionExporter.php index 556464da..c76c5a1c 100644 --- a/src/WebformSubmissionExporter.php +++ b/src/WebformSubmissionExporter.php @@ -257,6 +257,7 @@ class WebformSubmissionExporter implements WebformSubmissionExporterInterface { 'range_start' => '', 'range_end' => '', 'state' => 'all', + 'submissionlock' => '', 'sticky' => '', 'download' => TRUE, 'files' => FALSE, diff --git a/src/WebformSubmissionInterface.php b/src/WebformSubmissionInterface.php index 89e550aa..47701e33 100644 --- a/src/WebformSubmissionInterface.php +++ b/src/WebformSubmissionInterface.php @@ -26,6 +26,11 @@ interface WebformSubmissionInterface extends ContentEntityInterface, EntityOwner */ const STATE_COMPLETED = 'completed'; + /** + * Return status for submission that has been locked. + */ + const STATE_LOCKED = 'locked'; + /** * Return status for submission that has been updated. */ @@ -121,6 +126,36 @@ interface WebformSubmissionInterface extends ContentEntityInterface, EntityOwner */ public function setNotes($notes); + /** + * Get the submission's locked status. + * + * @return string + * The submission's lock status. + */ + public function isLocked(); + + /** + * Get the submission's unlocked status. + * + * @return string + * The submission's unlock status. + */ + public function isUnlocked(); + + /** + * Set the submission as locked. + * + * @return $this + */ + public function lock(); + + /** + * Set the submission as unlocked. + * + * @return $this + */ + public function unlock(); + /** * Get the submission's sticky flag. * diff --git a/src/WebformSubmissionListBuilder.php b/src/WebformSubmissionListBuilder.php index 5f9194ee..6399cdd3 100644 --- a/src/WebformSubmissionListBuilder.php +++ b/src/WebformSubmissionListBuilder.php @@ -19,6 +19,16 @@ use Drupal\webform\Utility\WebformDialogHelper; */ class WebformSubmissionListBuilder extends EntityListBuilder { + /** + * Submission state locked. + */ + const STATE_LOCKED = 'locked'; + + /** + * Submission state unstarred. + */ + const STATE_UNLOCKED = 'unlocked'; + /** * Submission state starred. */ @@ -258,6 +268,8 @@ class WebformSubmissionListBuilder extends EntityListBuilder { '' => $this->t('All [@total]', ['@total' => $this->getTotal(NULL, NULL)]), self::STATE_STARRED => $this->t('Starred [@total]', ['@total' => $this->getTotal(NULL, self::STATE_STARRED)]), self::STATE_UNSTARRED => $this->t('Unstarred [@total]', ['@total' => $this->getTotal(NULL, self::STATE_UNSTARRED)]), + self::STATE_LOCKED => $this->t('Locked[@total]', ['@total' => $this->getTotal(NULL, self::STATE_LOCKED)]), + self::STATE_UNLOCKED => $this->t('Unlocked [@total]', ['@total' => $this->getTotal(NULL, self::STATE_UNLOCKED)]), ]; // Add draft to state options. if (!$this->webform || $this->webform->getSetting('draft') != WebformInterface::DRAFT_NONE) { @@ -397,6 +409,13 @@ class WebformSubmissionListBuilder extends EntityListBuilder { 'field' => 'sticky', 'specifier' => 'sticky', ]; + case 'submissionlock': + return [ + 'data' => new FormattableMarkup('', ['@name' => $name]), + 'class' => ['webform-results__icon'], + 'field' => 'submissionlock', + 'specifier' => 'submissionlock', + ]; default: if (isset($column['sort']) && $column['sort'] === FALSE) { @@ -514,6 +533,23 @@ class WebformSubmissionListBuilder extends EntityListBuilder { case 'in_draft': return ($entity->isDraft()) ? $this->t('Yes') : $this->t('No'); + case 'submissionlock': + $route_name = 'entity.webform_submission.submissionlock_toggle'; + $route_parameters = ['webform' => $entity->getWebform()->id(), 'webform_submission' => $entity->id()]; + $state = $entity->isLocked() ? 'on' : 'off'; + return [ + 'data' => [ + '#type' => 'link', + '#title' => new FormattableMarkup('', ['@state' => $state]), + '#url' => Url::fromRoute($route_name, $route_parameters), + '#attributes' => [ + 'id' => 'webform-submission-' . $entity->id() . '-lock', + 'class' => ['use-ajax'], + ], + ], + 'class' => ['webform-results__icon'], + ]; + case 'sticky': $route_name = 'entity.webform_submission.sticky_toggle'; $route_parameters = ['webform' => $entity->getWebform()->id(), 'webform_submission' => $entity->id()]; @@ -594,7 +630,7 @@ class WebformSubmissionListBuilder extends EntityListBuilder { ]; } - if ($entity->access('update')) { + if ($entity->access('notes')) { $operations['notes'] = [ 'title' => $this->t('Notes'), 'weight' => 21, @@ -779,6 +815,14 @@ class WebformSubmissionListBuilder extends EntityListBuilder { $query->condition('sticky', 0); break; + case self::STATE_LOCKED: + $query->condition('submissionlock', 1); + break; + + case self::STATE_UNLOCKED: + $query->condition('submissionlock', 0); + break; + case self::STATE_DRAFT: $query->condition('in_draft', 1); break; diff --git a/src/WebformSubmissionNotesForm.php b/src/WebformSubmissionNotesForm.php index d9481055..c55b73f9 100644 --- a/src/WebformSubmissionNotesForm.php +++ b/src/WebformSubmissionNotesForm.php @@ -69,6 +69,13 @@ class WebformSubmissionNotesForm extends ContentEntityForm { '#description' => $this->t('Enter notes about this submission. These notes are only visible to submission administrators.'), '#default_value' => $webform_submission->getNotes(), ]; + $form['submissionlock'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Lock/Unlock Webform Submission'), + '#default_value' => $webform_submission->isLocked(), + '#return_value' => TRUE, + '#access' => $this->isDialog() ? FALSE : TRUE, + ]; $form['sticky'] = [ '#type' => 'checkbox', '#title' => $this->t('Star/flag the status of this submission'), diff --git a/src/WebformSubmissionStorage.php b/src/WebformSubmissionStorage.php index 8a9b3b78..ff8fd3c0 100644 --- a/src/WebformSubmissionStorage.php +++ b/src/WebformSubmissionStorage.php @@ -543,8 +543,12 @@ class WebformSubmissionStorage extends SqlContentEntityStorage implements Webfor 'default' => FALSE, ]; - // Sticky (Starred/Unstarred). + // Lock (Locked/Unlocked) - Sticky (Starred/Unstarred). if (empty($account)) { + $columns['submissionlock'] = [ + 'title' => $this->t('Locked'), + ]; + $columns['sticky'] = [ 'title' => $this->t('Starred'), ]; diff --git a/templates/webform-handler-action-summary.html.twig b/templates/webform-handler-action-summary.html.twig index ed852d81..fb1fe9a8 100644 --- a/templates/webform-handler-action-summary.html.twig +++ b/templates/webform-handler-action-summary.html.twig @@ -12,6 +12,7 @@ #} {% if settings.debug %}{{ 'Debugging is enabled'|t }}
{% endif %} +{% if settings.lock is not null %}{{ 'Submission Lock:'|t }} {{ settings.lock ? 'Locked'|t : 'Unlocked'|t }}
{% endif %} {% if settings.sticky is not null %}{{ 'Status:'|t }} {{ settings.sticky ? 'Flag/Star'|t : 'Unflag/Unstar'|t }}
{% endif %} {% if settings.notes %}{{ 'Notes:'|t }} {{ settings.notes }}
{% endif %} {% if settings.message %}{{ 'Message:'|t }} {{ settings.message }} ({{ settings.message_type }})
{% endif %} diff --git a/templates/webform-submission-information.html.twig b/templates/webform-submission-information.html.twig index ca1bbf3b..5f50fc28 100644 --- a/templates/webform-submission-information.html.twig +++ b/templates/webform-submission-information.html.twig @@ -41,8 +41,11 @@ {% if submitted_to %}
{{ 'Submitted to'|t }}: {{ submitted_to }}
{% endif %} - {% if sticky or notes %} + {% if submissionlock or sticky or notes %}
+ {% if submissionlock %} +
{{ 'Submission Lock'|t }}: {{ submissionlock }}
+ {% endif %} {% if sticky %}
{{ 'Flagged'|t }}: {{ sticky }}
{% endif %} diff --git a/webform.routing.yml b/webform.routing.yml index 5cb08d52..55ab34b3 100644 --- a/webform.routing.yml +++ b/webform.routing.yml @@ -520,7 +520,7 @@ entity.webform_submission.notes_form: _entity_form: 'webform_submission.notes' _title_callback: '\Drupal\webform\Controller\WebformSubmissionViewController::title' requirements: - _entity_access: 'webform_submission.update_any' + _entity_access: 'webform_submission.notes' entity.webform_submission.resend_form: path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/resend' @@ -547,12 +547,20 @@ entity.webform_submission.delete_form: requirements: _entity_access: 'webform_submission.delete' +entity.webform_submission.submissionlock_toggle: + path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/lock' + defaults: + _controller: '\Drupal\webform\Controller\WebformSubmissionController::lock' + requirements: + _entity_access: 'webform_submission.notes' + _csrf_token: 'TRUE' + entity.webform_submission.sticky_toggle: path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/sticky' defaults: _controller: '\Drupal\webform\Controller\WebformSubmissionController::sticky' requirements: - _entity_access: 'webform_submission.update' + _entity_access: 'webform_submission.notes' _csrf_token: 'TRUE' webform_submission.multiple_delete_confirm: