Skip to content

Commit

Permalink
HPC-9259: Add module Protected Pages, add custom module to handle som…
Browse files Browse the repository at this point in the history
…e specifics about embargoed content, add configuration, bulk actions and update permissions
  • Loading branch information
berliner committed Nov 20, 2023
1 parent bb408db commit 77dc37a
Show file tree
Hide file tree
Showing 29 changed files with 715 additions and 7 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"drupal/page_manager": "^4.0@beta",
"drupal/pathauto": "^1.8",
"drupal/phpexcel": "^4.0",
"drupal/protected_pages": "^1.6",
"drupal/publishcontent": "^1.6",
"drupal/queue_ui": "^3.1",
"drupal/rabbit_hole": "^1.0@beta",
Expand Down
53 changes: 51 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions composer.patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"drupal/page_manager": {
"Issue #3176661: Allow to edit page title when using Layout Builder variant": "https://www.drupal.org/files/issues/2022-11-15/page_manager-lb-title-3176661-15.patch"
},
"drupal/protected_pages": {
"Issue #3024997: Global password is requested multiple times for every protected page": "https://www.drupal.org/files/issues/2023-11-20/3024997-11-reroll-8.patch"
},
"drupal/publishcontent": {
"Issue #2820867: Bulk operations actions skip 'publishcontent' defined permissions": "https://www.drupal.org/files/issues/2020-07-22/2820867-7-permissions-for-bulk-operations.patch"
},
Expand Down
2 changes: 2 additions & 0 deletions config/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module:
ghi_base_objects: 0
ghi_blocks: 0
ghi_content: 0
ghi_embargoed_access: 0
ghi_form_elements: 0
ghi_gin: 0
ghi_hero_image: 0
Expand Down Expand Up @@ -100,6 +101,7 @@ module:
path: 0
path_alias: 0
phpexcel: 0
protected_pages: 0
publishcontent: 0
queue_ui: 0
rabbit_hole: 0
Expand Down
3 changes: 3 additions & 0 deletions config/ghi_embargoed_access.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_core:
default_config_hash: KhBLA3nouSdIVDBWen9UHN71v2RCEWFem9zwn7C9XC4
enabled: true
19 changes: 19 additions & 0 deletions config/protected_pages.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
_core:
default_config_hash: fcx2bfv-TfdQ_hGuvq4GkK3SAeANYibuVJMcEJBGG38
langcode: en
password:
per_page_or_global: only_global
protected_pages_session_expire_time: '0'
enter_password_once: '1'
validate_per_section: true
protected_pages_global_password: $2y$10$xP0doQlJn.LFMdJO49YJ4uR53yJrRkjKn364MZyzUHlcZN4NeBOUW
email:
subject: 'Please visit this new page'
body: "Dear friend,\r\n\r\nI just created a new page on my website and wanted to invite you to visit. The page is protected by password. Please find the details below:-\r\n\r\nPage Url = [protected-page-url]\r\n\r\nPage Password = password here\r\n\r\nThank you.\r\n[site-name]"
others:
protected_pages_title: 'GHO embargoed access'
protected_pages_description: "<p>\r\nThe page you are trying to view is password protected.<br />\r\nPlease enter the password you have received by email to access the embargoed content.\r\n</p>"
protected_pages_password_fieldset_legend: ''
protected_pages_password_label: Password
protected_pages_submit_button_text: Submit
protected_pages_incorrect_password_msg: 'An incorrect password was submitted. Please check your password and try again.'
13 changes: 13 additions & 0 deletions config/system.action.protect_content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
uuid: b6324a7b-f553-44e2-9ed4-382df0ef5cac
langcode: en
status: true
dependencies:
module:
- ghi_embargoed_access
_core:
default_config_hash: SVo71HduKFbRs1uPA_qEluJ_mFJSz6vXrQ19ZSObuU8
id: protect_content
label: 'Protect Content'
type: node
plugin: protect_content
configuration: { }
13 changes: 13 additions & 0 deletions config/system.action.unprotect_content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
uuid: d64129aa-a465-4438-92c7-0f5970603b69
langcode: en
status: true
dependencies:
module:
- ghi_embargoed_access
_core:
default_config_hash: 03CbUBTrNYTt7-XQZn1cwc4fMixXExZVVwVPjs5TQOM
id: unprotect_content
label: 'Unprotect Content'
type: node
plugin: unprotect_content
configuration: { }
2 changes: 2 additions & 0 deletions config/user.role.anonymous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ langcode: en
status: true
dependencies:
module:
- protected_pages
- system
_core:
default_config_hash: j5zLMOdJBqC0bMvSdth5UebkprJB8g_2FXHqhfpJzow
Expand All @@ -12,3 +13,4 @@ weight: -10
is_admin: false
permissions:
- 'access content'
- 'access protected page password screen'
2 changes: 2 additions & 0 deletions config/user.role.authenticated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ langcode: en
status: true
dependencies:
module:
- protected_pages
- system
_core:
default_config_hash: dJ0L2DNSj5q6XVZAGsuVDpJTh5UeYkIPwKrUOOpr8YI
Expand All @@ -12,3 +13,4 @@ weight: -9
is_admin: false
permissions:
- 'access content'
- 'access protected page password screen'
116 changes: 115 additions & 1 deletion config/views.view.content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ dependencies:
- node.type.custom_subpage
- node.type.document
- node.type.financials
- node.type.logframe
- node.type.global_section
- node.type.homepage
- node.type.logframe
- node.type.news_story
- node.type.page
- node.type.plan_cluster
- node.type.population
- node.type.presence
- node.type.progress
- node.type.section
- taxonomy.vocabulary.tags
- taxonomy.vocabulary.team
module:
- ghi_base_objects
- ghi_content
- ghi_embargoed_access
- node
- taxonomy
- user
Expand Down Expand Up @@ -1366,6 +1368,8 @@ display:
selected_actions:
- node_publish_action
- node_unpublish_action
- protect_content
- unprotect_content
title:
id: title
table: node_field_data
Expand Down Expand Up @@ -1536,6 +1540,60 @@ display:
format: custom
format_custom_false: Unpublished
format_custom_true: Published
protected_status:
id: protected_status
table: node
field: protected_status
relationship: none
group_type: group
admin_label: ''
entity_type: node
plugin_id: protected_status
label: Protected
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
type: yes-no
type_custom_true: ''
type_custom_false: ''
not: 0
changed:
id: changed
table: node_field_data
Expand Down Expand Up @@ -2618,6 +2676,8 @@ display:
selected_actions:
- node_publish_action
- node_unpublish_action
- protect_content
- unprotect_content
title:
id: title
table: node_field_data
Expand Down Expand Up @@ -2788,6 +2848,60 @@ display:
format: custom
format_custom_false: Unpublished
format_custom_true: Published
protected_status:
id: protected_status
table: node
field: protected_status
relationship: none
group_type: group
admin_label: ''
entity_type: node
plugin_id: protected_status
label: Protected
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
type: yes-no
type_custom_true: ''
type_custom_false: ''
not: 0
changed:
id: changed
table: node_field_data
Expand Down
6 changes: 2 additions & 4 deletions config_dev/language/fr/views.view.watchdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ display:
label: Type
timestamp:
label: Date
message:
label: Message
name:
label: Utilisateur
link:
Expand All @@ -22,11 +24,7 @@ display:
submit_button: Filtrer
reset_button_label: Réinitialiser
exposed_sorts_label: 'Trier par'
sort_asc_label: Asc
sort_desc_label: Desc
filters:
type:
expose:
label: Type
page:
display_title: Page
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enabled: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
langcode: en
status: true
dependencies:
module:
- node
id: protect_content
label: 'Protect Content'
type: node
plugin: protect_content
configuration: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
langcode: en
status: true
dependencies:
module:
- node
id: unprotect_content
label: 'Unprotect Content'
type: node
plugin: unprotect_content
configuration: { }
Loading

0 comments on commit 77dc37a

Please sign in to comment.