Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2442 from ec-europa/ISAICP-6355
Browse files Browse the repository at this point in the history
ISAICP-6355: Update permissions and allow other users to use the JSON map field.
  • Loading branch information
pfrenssen authored Apr 13, 2021
2 parents 5388df0 + 6dd36ad commit d09c72f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 49 deletions.
2 changes: 1 addition & 1 deletion config/sync/field.field.paragraph.json_map.field_json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://europa.eu/webtools/mgmt/wizard/ui.php?uec=bmap" target="_blank">Basic map (BMAP) wizard</a> to create one.'
required: true
translatable: false
default_value: { }
Expand Down
15 changes: 3 additions & 12 deletions config/sync/og.og_role.rdf_entity-collection-facilitator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ 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 paragraph content json_map'
- 'create rdf entity news'
- 'create solution rdf_entity'
- 'delete any custom_page content'
Expand All @@ -41,10 +38,7 @@ 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'
- 'delete paragraph content json_map'
- 'edit any custom_page content'
- 'edit any discussion content'
- 'edit any document content'
Expand Down Expand Up @@ -149,10 +143,7 @@ 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'
- 'update paragraph content json_map'
- 'view all revisions'
- 'view any tallinn_report content'
- 'view any unpublished content'
Expand Down
12 changes: 0 additions & 12 deletions config/sync/og.og_role.rdf_entity-solution-facilitator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
12 changes: 12 additions & 0 deletions config/sync/user.role.authenticated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ 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 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 simple_paragraph'
- 'edit own comments'
- 'edit own contact_information rdf entity'
- 'edit own owner rdf entity'
Expand Down Expand Up @@ -90,6 +98,10 @@ 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 simple_paragraph'
- 'use text format basic_html'
- 'use text format content_editor'
- 'use text format glossary_html'
Expand Down
17 changes: 0 additions & 17 deletions config/sync/user.role.moderator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ 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'
Expand All @@ -73,24 +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 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'
- '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'
Expand Down Expand Up @@ -236,12 +223,8 @@ 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'
Expand Down
29 changes: 22 additions & 7 deletions tests/features/paragraphs/custom_page.paragraphs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,37 @@ 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: Privileged users 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 |

# 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"

Given I am logged in as a facilitator of the "Paragraphs collection" collection
# 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"
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"
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"
Expand Down

0 comments on commit d09c72f

Please sign in to comment.