From 299d368f3813e83674b2f6f63e433cc279b4e549 Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Thu, 1 Apr 2021 12:15:47 +0300 Subject: [PATCH 1/5] ISAICP-6355: Update permissions and allow other users to use the JSON map field. --- .../field.field.paragraph.json_map.field_json.yml | 2 +- ....og_role.rdf_entity-collection-facilitator.yml | 12 ------------ ...og.og_role.rdf_entity-solution-facilitator.yml | 12 ------------ config/sync/user.role.authenticated.yml | 15 +++++++++++++++ config/sync/user.role.moderator.yml | 15 --------------- 5 files changed, 16 insertions(+), 40 deletions(-) diff --git a/config/sync/field.field.paragraph.json_map.field_json.yml b/config/sync/field.field.paragraph.json_map.field_json.yml index fc3fef4fbb..e10e372ecc 100644 --- a/config/sync/field.field.paragraph.json_map.field_json.yml +++ b/config/sync/field.field.paragraph.json_map.field_json.yml @@ -12,7 +12,7 @@ field_name: field_json entity_type: paragraph bundle: json_map label: JSON -description: 'Enter a JSON serialized string representing the map.' +description: 'Enter a JSON serialized string representing the map, or use the Basic map (BMAP) wizard to create one.' required: true translatable: false default_value: { } diff --git a/config/sync/og.og_role.rdf_entity-collection-facilitator.yml b/config/sync/og.og_role.rdf_entity-collection-facilitator.yml index 203674d735..e39b1dd12e 100644 --- a/config/sync/og.og_role.rdf_entity-collection-facilitator.yml +++ b/config/sync/og.og_role.rdf_entity-collection-facilitator.yml @@ -27,10 +27,6 @@ permissions: - 'create event content' - 'create glossary content' - 'create news content' - - 'create paragraph content accordion' - - 'create paragraph content accordion_item' - - 'create paragraph content content_listing' - - 'create paragraph content simple_paragraph' - 'create rdf entity news' - 'create solution rdf_entity' - 'delete any custom_page content' @@ -41,10 +37,6 @@ permissions: - 'delete any glossary content' - 'delete any news content' - 'delete contact_information rdf entity' - - 'delete paragraph content accordion' - - 'delete paragraph content accordion_item' - - 'delete paragraph content content_listing' - - 'delete paragraph content simple_paragraph' - 'edit any custom_page content' - 'edit any discussion content' - 'edit any document content' @@ -149,10 +141,6 @@ permissions: - 'update any navigation ogmenu_instance' - 'update collection_settings meta-entity' - 'update group' - - 'update paragraph content accordion' - - 'update paragraph content accordion_item' - - 'update paragraph content content_listing' - - 'update paragraph content simple_paragraph' - 'view all revisions' - 'view any tallinn_report content' - 'view any unpublished content' diff --git a/config/sync/og.og_role.rdf_entity-solution-facilitator.yml b/config/sync/og.og_role.rdf_entity-solution-facilitator.yml index 154e3d95ca..b9e787b17f 100644 --- a/config/sync/og.og_role.rdf_entity-solution-facilitator.yml +++ b/config/sync/og.og_role.rdf_entity-solution-facilitator.yml @@ -24,10 +24,6 @@ permissions: - 'create event content' - 'create glossary content' - 'create news content' - - 'create paragraph content accordion' - - 'create paragraph content accordion_item' - - 'create paragraph content content_listing' - - 'create paragraph content simple_paragraph' - 'delete any asset_distribution rdf_entity' - 'delete any custom_page content' - 'delete any discussion content' @@ -36,10 +32,6 @@ permissions: - 'delete any news content' - 'delete asset_distribution rdf entity' - 'delete contact_information rdf entity' - - 'delete paragraph content accordion' - - 'delete paragraph content accordion_item' - - 'delete paragraph content content_listing' - - 'delete paragraph content simple_paragraph' - 'edit any custom_page content' - 'edit any discussion content' - 'edit any glossary content' @@ -143,10 +135,6 @@ permissions: - 'update group' - 'update own asset_distribution rdf_entity' - 'update own asset_release rdf_entity' - - 'update paragraph content accordion' - - 'update paragraph content accordion_item' - - 'update paragraph content content_listing' - - 'update paragraph content simple_paragraph' - 'view all revisions' - 'view any unpublished content' - 'view rdf entity' diff --git a/config/sync/user.role.authenticated.yml b/config/sync/user.role.authenticated.yml index 4d034c7d0a..9eff80d61f 100644 --- a/config/sync/user.role.authenticated.yml +++ b/config/sync/user.role.authenticated.yml @@ -16,8 +16,18 @@ permissions: - 'create contact_information rdf entity' - 'create document content' - 'create owner rdf entity' + - 'create paragraph content accordion' + - 'create paragraph content accordion_item' + - 'create paragraph content content_listing' + - 'create paragraph content json_map' + - 'create paragraph content simple_paragraph' - 'delete own comments' - 'delete own document content' + - 'delete paragraph content accordion' + - 'delete paragraph content accordion_item' + - 'delete paragraph content content_listing' + - 'delete paragraph content json_map' + - 'delete paragraph content simple_paragraph' - 'edit own comments' - 'edit own contact_information rdf entity' - 'edit own owner rdf entity' @@ -86,6 +96,11 @@ permissions: - 'transition own node news from validated to validated using the community_content - node:post_moderated workflow' - 'unflag subscribe_discussions' - 'update own document content' + - 'update paragraph content accordion' + - 'update paragraph content accordion_item' + - 'update paragraph content content_listing' + - 'update paragraph content json_map' + - 'update paragraph content simple_paragraph' - 'use text format basic_html' - 'use text format content_editor' - 'use text format glossary_html' diff --git a/config/sync/user.role.moderator.yml b/config/sync/user.role.moderator.yml index 508822ad1e..673ca37dab 100644 --- a/config/sync/user.role.moderator.yml +++ b/config/sync/user.role.moderator.yml @@ -52,12 +52,7 @@ permissions: - 'create licence rdf entity' - 'create news_banner media' - 'create news_logo media' - - 'create paragraph content accordion' - - 'create paragraph content accordion_item' - - 'create paragraph content content_listing' - 'create paragraph content iframe' - - 'create paragraph content json_map' - - 'create paragraph content simple_paragraph' - 'create rdf entity news' - 'create solution releases' - 'create solution_banner media' @@ -78,12 +73,7 @@ permissions: - 'delete licence rdf entity' - 'delete owner rdf entity' - 'delete owner rdf entity' - - 'delete paragraph content accordion' - - 'delete paragraph content accordion_item' - - 'delete paragraph content content_listing' - 'delete paragraph content iframe' - - 'delete paragraph content json_map' - - 'delete paragraph content simple_paragraph' - 'delete site alerts' - 'download subscribers report' - 'edit any collection_banner media' @@ -236,12 +226,7 @@ permissions: - 'unpin entity' - 'update any simple_block block content' - 'update collection_settings meta-entity' - - 'update paragraph content accordion' - - 'update paragraph content accordion_item' - - 'update paragraph content content_listing' - 'update paragraph content iframe' - - 'update paragraph content json_map' - - 'update paragraph content simple_paragraph' - 'update site alerts' - 'view any unpublished content' - 'view field_is_eif_category' From 357363185911671c8e9f5c35f60f218c677a4591 Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Wed, 7 Apr 2021 21:37:52 +0300 Subject: [PATCH 2/5] ISAICP-6355: Test that facilitators can see the 'Add Map' button. --- tests/features/paragraphs/custom_page.paragraphs.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/features/paragraphs/custom_page.paragraphs.feature b/tests/features/paragraphs/custom_page.paragraphs.feature index ceec4c33d3..cda14a73d7 100644 --- a/tests/features/paragraphs/custom_page.paragraphs.feature +++ b/tests/features/paragraphs/custom_page.paragraphs.feature @@ -52,8 +52,8 @@ Feature: Given I am logged in as a facilitator of the "Paragraphs collection" collection And I go to the custom_page "Don't Mess with the Zohan" edit screen Then I should see the button "Add Simple paragraph" - But I should not see the button "Add Map" - And I should not see the button "Add IFrame" + And I should see the button "Add Map" + But I should not see the button "Add IFrame" When I fill in "Body" with "I'm half Australian, half Mt. Everest" And I press "Save" From ae759cd7a52ab656e22bb6cda0ecb813d7de8454 Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Mon, 12 Apr 2021 10:26:51 +0300 Subject: [PATCH 3/5] ISAICP-6355: Do not allow authors of content to edit the json_map. --- .../sync/og.og_role.rdf_entity-collection-facilitator.yml | 3 +++ config/sync/user.role.authenticated.yml | 3 --- config/sync/user.role.moderator.yml | 8 +++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/config/sync/og.og_role.rdf_entity-collection-facilitator.yml b/config/sync/og.og_role.rdf_entity-collection-facilitator.yml index e39b1dd12e..627db1ef9a 100644 --- a/config/sync/og.og_role.rdf_entity-collection-facilitator.yml +++ b/config/sync/og.og_role.rdf_entity-collection-facilitator.yml @@ -27,6 +27,7 @@ permissions: - 'create event content' - 'create glossary content' - 'create news content' + - 'create paragraph content json_map' - 'create rdf entity news' - 'create solution rdf_entity' - 'delete any custom_page content' @@ -37,6 +38,7 @@ permissions: - 'delete any glossary content' - 'delete any news content' - 'delete contact_information rdf entity' + - 'delete paragraph content json_map' - 'edit any custom_page content' - 'edit any discussion content' - 'edit any document content' @@ -141,6 +143,7 @@ permissions: - 'update any navigation ogmenu_instance' - 'update collection_settings meta-entity' - 'update group' + - 'update paragraph content json_map' - 'view all revisions' - 'view any tallinn_report content' - 'view any unpublished content' diff --git a/config/sync/user.role.authenticated.yml b/config/sync/user.role.authenticated.yml index 7fb62fc066..dd7e94543a 100644 --- a/config/sync/user.role.authenticated.yml +++ b/config/sync/user.role.authenticated.yml @@ -19,14 +19,12 @@ permissions: - 'create paragraph content accordion' - 'create paragraph content accordion_item' - 'create paragraph content content_listing' - - 'create paragraph content json_map' - 'create paragraph content simple_paragraph' - 'delete own comments' - 'delete own document content' - 'delete paragraph content accordion' - 'delete paragraph content accordion_item' - 'delete paragraph content content_listing' - - 'delete paragraph content json_map' - 'delete paragraph content simple_paragraph' - 'edit own comments' - 'edit own contact_information rdf entity' @@ -103,7 +101,6 @@ permissions: - 'update paragraph content accordion' - 'update paragraph content accordion_item' - 'update paragraph content content_listing' - - 'update paragraph content json_map' - 'update paragraph content simple_paragraph' - 'use text format basic_html' - 'use text format content_editor' diff --git a/config/sync/user.role.moderator.yml b/config/sync/user.role.moderator.yml index 673ca37dab..3f15b5788f 100644 --- a/config/sync/user.role.moderator.yml +++ b/config/sync/user.role.moderator.yml @@ -53,6 +53,7 @@ permissions: - 'create news_banner media' - 'create news_logo media' - 'create paragraph content iframe' + - 'create paragraph content json_map' - 'create rdf entity news' - 'create solution releases' - 'create solution_banner media' @@ -68,19 +69,15 @@ permissions: - 'delete any solution_logo media' - 'delete asset_release rdf entity' - 'delete contact_information rdf entity' - - 'delete contact_information rdf entity' - - 'delete licence rdf entity' - 'delete licence rdf entity' - 'delete owner rdf entity' - - 'delete owner rdf entity' - 'delete paragraph content iframe' + - 'delete paragraph content json_map' - 'delete site alerts' - 'download subscribers report' - 'edit any collection_banner media' - 'edit any collection_logo media' - 'edit any custom_page content' - - 'edit any custom_page content' - - 'edit any discussion content' - 'edit any discussion content' - 'edit any event_banner media' - 'edit any event_logo media' @@ -227,6 +224,7 @@ permissions: - 'update any simple_block block content' - 'update collection_settings meta-entity' - 'update paragraph content iframe' + - 'update paragraph content json_map' - 'update site alerts' - 'view any unpublished content' - 'view field_is_eif_category' From 6b7ccb7ff342f9eb40d9fe68e748da4d695decf6 Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Mon, 12 Apr 2021 10:33:11 +0300 Subject: [PATCH 4/5] ISAICP-6355: Extend the tests for the author of the content - and a member too. --- .../paragraphs/custom_page.paragraphs.feature | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/features/paragraphs/custom_page.paragraphs.feature b/tests/features/paragraphs/custom_page.paragraphs.feature index cda14a73d7..302d335f90 100644 --- a/tests/features/paragraphs/custom_page.paragraphs.feature +++ b/tests/features/paragraphs/custom_page.paragraphs.feature @@ -44,12 +44,24 @@ Feature: | BBBBBBBBBB | | AAAAAAAAAA | - Scenario: Moderators can add a map and/or an iframe paragraph. - Given custom_page content: - | title | body | collection | - | Don't Mess with the Zohan | Wanna mess? | Paragraphs collection | + Scenario: Moderators can add a map and/or an iframe and map paragraph. + Given users: + | Username | + | Zohan | + And the following collection user membership: + | collection | user | + | Paragraphs collection | Zohan | + And custom_page content: + | title | body | collection | author | + | Don't Mess with the Zohan | Wanna mess? | Paragraphs collection | Zohan | + + When I am logged in as "Zohan" + And I go to the custom_page "Don't Mess with the Zohan" edit screen + Then I should see the button "Add Simple paragraph" + And I should not see the button "Add Map" + But I should not see the button "Add IFrame" - Given I am logged in as a facilitator of the "Paragraphs collection" collection + When I am logged in as a facilitator of the "Paragraphs collection" collection And I go to the custom_page "Don't Mess with the Zohan" edit screen Then I should see the button "Add Simple paragraph" And I should see the button "Add Map" From 6dd36ad2a6124dc30c2b530e3f91bed3a5796e11 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Tue, 13 Apr 2021 10:21:42 +0300 Subject: [PATCH 5/5] ISAICP-6355: Update documentation. Maps can now also be added by facilitators. --- tests/features/paragraphs/custom_page.paragraphs.feature | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/features/paragraphs/custom_page.paragraphs.feature b/tests/features/paragraphs/custom_page.paragraphs.feature index 302d335f90..8c73698c0a 100644 --- a/tests/features/paragraphs/custom_page.paragraphs.feature +++ b/tests/features/paragraphs/custom_page.paragraphs.feature @@ -44,7 +44,7 @@ Feature: | BBBBBBBBBB | | AAAAAAAAAA | - Scenario: Moderators can add a map and/or an iframe and map paragraph. + Scenario: Privileged users can add a map and/or an iframe and map paragraph. Given users: | Username | | Zohan | @@ -55,12 +55,14 @@ Feature: | title | body | collection | author | | Don't Mess with the Zohan | Wanna mess? | Paragraphs collection | Zohan | + # Normal members cannot add maps. When I am logged in as "Zohan" And I go to the custom_page "Don't Mess with the Zohan" edit screen Then I should see the button "Add Simple paragraph" And I should not see the button "Add Map" But I should not see the button "Add IFrame" + # Facilitators can add maps. When I am logged in as a facilitator of the "Paragraphs collection" collection And I go to the custom_page "Don't Mess with the Zohan" edit screen Then I should see the button "Add Simple paragraph" @@ -72,6 +74,7 @@ Feature: Then I should see the success message "Custom page Don't Mess with the Zohan has been updated." And I should see "I'm half Australian, half Mt. Everest" + # Moderators can add maps. Given I am logged in as a moderator And I go to the custom_page "Don't Mess with the Zohan" edit screen Then I should see the button "Add Simple paragraph"