Skip to content
Snippets Groups Projects
Commit 9b9311cb authored by jurgenhaas's avatar jurgenhaas
Browse files

Update patch for webform

parent c4753189
No related branches found
No related tags found
1 merge request!349Merging develop into main
Pipeline #1354173 skipped
diff --git a/src/WebformEntityListBuilder.php b/src/WebformEntityListBuilder.php diff --git a/src/WebformEntityListBuilder.php b/src/WebformEntityListBuilder.php
index 827110be1d819f7e7090c415498d0a747ada0765..1b3cc372d5ee8025ab983faf98cd6695fb505f2a 100644 index 827110be1d819f7e7090c415498d0a747ada0765..c27958aa5b7e3b3dfa31f4f4a23722fb4942ba56 100644
--- a/src/WebformEntityListBuilder.php --- a/src/WebformEntityListBuilder.php
+++ b/src/WebformEntityListBuilder.php +++ b/src/WebformEntityListBuilder.php
@@ -173,7 +173,7 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder { @@ -173,8 +173,11 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder {
$build['table']['#attributes']['class'][] = 'webform-forms'; $build['table']['#attributes']['class'][] = 'webform-forms';
// Bulk operations. // Bulk operations.
- if ($this->bulkOperations && $this->currentUser->hasPermission('administer webform')) { - if ($this->bulkOperations && $this->currentUser->hasPermission('administer webform')) {
+ if ($this->bulkOperations && ($this->currentUser->hasPermission('administer webform') || $this->currentUser->hasPermission('administer webform overview'))) { + if ($this->bulkOperations && ($this->currentUser->hasPermission('administer webform') || $this->currentUser->hasPermission('administer webform overview'))) {
$build['table'] = \Drupal::formBuilder()->getForm('\Drupal\webform\Form\WebformEntityBulkForm', $build['table']); $build['table'] = \Drupal::formBuilder()->getForm('\Drupal\webform\Form\WebformEntityBulkForm', $build['table']);
+ if (!$this->currentUser->hasPermission('delete any webform')) {
+ unset($build['table']['operations']['action']['#options']['webform_delete_action']);
+ }
} }
@@ -194,7 +194,7 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder { // Attachments.
@@ -194,7 +197,7 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder {
*/ */
protected function buildFilterForm() { protected function buildFilterForm() {
// Add the filter by key(word) and/or state. // Add the filter by key(word) and/or state.
...@@ -20,7 +24,7 @@ index 827110be1d819f7e7090c415498d0a747ada0765..1b3cc372d5ee8025ab983faf98cd6695 ...@@ -20,7 +24,7 @@ index 827110be1d819f7e7090c415498d0a747ada0765..1b3cc372d5ee8025ab983faf98cd6695
$state_options = [ $state_options = [
(string) $this->t('Active') => [ (string) $this->t('Active') => [
'' => $this->t('All [@total]', ['@total' => $this->getTotal(NULL, NULL)]), '' => $this->t('All [@total]', ['@total' => $this->getTotal(NULL, NULL)]),
@@ -231,7 +231,7 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder { @@ -231,7 +234,7 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder {
*/ */
protected function buildInfo() { protected function buildInfo() {
// Display info. // Display info.
...@@ -29,7 +33,7 @@ index 827110be1d819f7e7090c415498d0a747ada0765..1b3cc372d5ee8025ab983faf98cd6695 ...@@ -29,7 +33,7 @@ index 827110be1d819f7e7090c415498d0a747ada0765..1b3cc372d5ee8025ab983faf98cd6695
return [ return [
'#markup' => $this->formatPlural($total, '@count webform', '@count webforms'), '#markup' => $this->formatPlural($total, '@count webform', '@count webforms'),
'#prefix' => '<div>', '#prefix' => '<div>',
@@ -672,12 +672,12 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder { @@ -672,12 +675,12 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder {
* Is the current user a webform administrator. * Is the current user a webform administrator.
* *
* @return bool * @return bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment