From d755555defdd2e9498e1e362d88c8fe268fba444 Mon Sep 17 00:00:00 2001 From: Shdulin <Shdulin@2744301.no-reply.drupal.org> Date: Tue, 4 Aug 2020 14:41:52 -0600 Subject: [PATCH] Issue #3162593 by Oleksiy: Wrong permission --- src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php b/src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php index bbde48af..5156b91f 100644 --- a/src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php +++ b/src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php @@ -1046,7 +1046,7 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi // Switching layouts should change the layout plugin options form // with Ajax for users with adequate permissions. - if ($this->currentUser->hasPermission('edit entity reference layout plugin config')) { + if ($this->currentUser->hasPermission('edit layout paragraphs plugin config')) { $element['entity_form']['layout_selection']['layout']['#ajax'] = [ 'event' => 'change', 'callback' => [$this, 'buildLayoutConfigurationFormAjax'], @@ -1063,7 +1063,7 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi $element['entity_form']['layout_plugin_form'] = [ '#prefix' => '<div id="layout-config">', '#suffix' => '</div>', - '#access' => $this->currentUser->hasPermission('edit entity reference layout plugin config'), + '#access' => $this->currentUser->hasPermission('edit layout paragraphs plugin config'), ]; // Add the layout configuration form if applicable. -- GitLab