From e85eed5ede4f8e3e5ce08f9752745578bd239a6f Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 7 Aug 2025 12:42:35 +1000 Subject: [PATCH] Fixed Env indicator, Coffee and paragraphs library permissions for site Administrator. --- config/default/user.role.authenticated.yml | 3 --- ...user.role.civictheme_site_administrator.yml | 9 +++++++++ tests/behat/features/coffee_access.feature | 11 +++++++++++ tests/behat/features/diff.feature | 2 +- .../environment_indicator_access.feature | 11 +++++++++++ .../features/paragraphs_library_access.feature | 18 ++++++++++++++++++ 6 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 tests/behat/features/coffee_access.feature create mode 100644 tests/behat/features/environment_indicator_access.feature create mode 100644 tests/behat/features/paragraphs_library_access.feature diff --git a/config/default/user.role.authenticated.yml b/config/default/user.role.authenticated.yml index b3ecf2e..5a4e0b8 100644 --- a/config/default/user.role.authenticated.yml +++ b/config/default/user.role.authenticated.yml @@ -6,7 +6,6 @@ dependencies: - filter.format.webform_default module: - contact - - diff - file - filter - media @@ -20,8 +19,6 @@ is_admin: false permissions: - 'access content' - 'access site-wide contact form' - - 'compare revisions' - 'delete own files' - 'use text format webform_default' - 'view media' - - 'view revisions' diff --git a/config/default/user.role.civictheme_site_administrator.yml b/config/default/user.role.civictheme_site_administrator.yml index 949ff2c..e459dcb 100644 --- a/config/default/user.role.civictheme_site_administrator.yml +++ b/config/default/user.role.civictheme_site_administrator.yml @@ -24,13 +24,16 @@ dependencies: module: - block - block_content + - coffee - content_moderation - contextual + - environment_indicator - file - filter - linkit - media - node + - paragraphs_library - path - pathauto - redirect @@ -49,8 +52,10 @@ permissions: - 'access administration pages' - 'access any webform configuration' - 'access block library' + - 'access coffee' - 'access content overview' - 'access contextual links' + - 'access environment indicator' - 'access files overview' - 'access media overview' - 'access own webform configuration' @@ -65,11 +70,13 @@ permissions: - 'administer account settings' - 'administer block content' - 'administer blocks' + - 'administer environment indicator settings' - 'administer linkit profiles' - 'administer media' - 'administer media types' - 'administer menu' - 'administer nodes' + - 'administer paragraphs library' - 'administer redirects' - 'administer scheduled transitions' - 'administer taxonomy' @@ -95,6 +102,7 @@ permissions: - 'create civictheme_social_links block content' - 'create civictheme_video media' - 'create media' + - 'create paragraph library item' - 'create terms in civictheme_media_tags' - 'create terms in civictheme_topics' - 'create url aliases' @@ -166,6 +174,7 @@ permissions: - 'edit own civictheme_video media' - 'edit own webform' - 'edit own webform submission' + - 'edit paragraph library item' - 'edit terms in civictheme_media_tags' - 'edit terms in civictheme_topics' - 'edit webform assets' diff --git a/tests/behat/features/coffee_access.feature b/tests/behat/features/coffee_access.feature new file mode 100644 index 0000000..9f5eb93 --- /dev/null +++ b/tests/behat/features/coffee_access.feature @@ -0,0 +1,11 @@ +Feature: Coffee module access for site administrator + + As a site administrator + I want to access the coffee module functionality + So that I can quickly navigate the site + + @api @javascript + Scenario: Site administrator can see coffee form wrapper after triggering + Given I am logged in as a user with the "civictheme_site_administrator" role + When I visit "/" + Then I should see an ".coffee-form-wrapper" element diff --git a/tests/behat/features/diff.feature b/tests/behat/features/diff.feature index 716e283..c85d552 100644 --- a/tests/behat/features/diff.feature +++ b/tests/behat/features/diff.feature @@ -6,7 +6,7 @@ Feature: Diff module for revision comparison So that I can track changes and understand what was modified Scenario: Content author can access and use revision comparison - Given I am logged in as a user with the "Administrator" role + Given I am logged in as a user with the "civictheme_site_administrator" role When I visit "node/add/civictheme_page" And I fill in "Title" with "[TEST] Page for Diff" And I fill in "Summary" with "Initial summary" diff --git a/tests/behat/features/environment_indicator_access.feature b/tests/behat/features/environment_indicator_access.feature new file mode 100644 index 0000000..42f32c8 --- /dev/null +++ b/tests/behat/features/environment_indicator_access.feature @@ -0,0 +1,11 @@ +Feature: Environment indicator access for site administrator + + As a site administrator + I want to see the environment indicator + So that I know which environment I'm working in + + @api @javascript + Scenario: Site administrator can see environment indicator toolbar styling + Given I am logged in as a user with the "civictheme_site_administrator" role + When I visit "/" + Then the element ".toolbar-menu-administration" with the attribute "style" and the value containing "border-left-color" should exist diff --git a/tests/behat/features/paragraphs_library_access.feature b/tests/behat/features/paragraphs_library_access.feature new file mode 100644 index 0000000..4d9285a --- /dev/null +++ b/tests/behat/features/paragraphs_library_access.feature @@ -0,0 +1,18 @@ +Feature: Paragraphs library access for site administrator + + As a site administrator + I want to access and manage the paragraphs library + So that I can create and reuse paragraph components + + @api + Scenario: Site administrator can access paragraphs library + Given I am logged in as a user with the "civictheme_site_administrator" role + When I visit "/admin/content/paragraphs" + Then the response status code should be 200 + And I should see the text "Paragraphs library" + + @api + Scenario: Site administrator can create paragraph library items + Given I am logged in as a user with the "civictheme_site_administrator" role + When I visit "/admin/content/paragraphs/add/default" + Then the response status code should be 200 \ No newline at end of file