From a1c98d5765a868a6056be4f37c82f1deb6dd668a Mon Sep 17 00:00:00 2001 From: Marc Berger Date: Wed, 20 Nov 2024 17:14:32 -0800 Subject: [PATCH] feat(SHS-5907): Update code with some bug fixes and changes, add update hook for suhumsci to allow site manager to use content access simple --- composer.json | 2 +- composer.lock | 14 +++++++------- config/default/content_access_simple.settings.yml | 3 +-- config/default/user.role.site_manager.yml | 1 + .../su_humsci_profile/su_humsci_profile.install | 10 ++++++++++ 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 536cdd805..3e4af0ede 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "php": ">=8.3", "acquia/blt": "^13.5", "acquia/blt-multisite": "^1.0", - "codechefmarc/content_access_simple": "1.1.1", + "codechefmarc/content_access_simple": "1.1.2", "composer/installers": "^1.9", "cweagans/composer-patches": "^1.7", "dinbror/blazy": "^1.8", diff --git a/composer.lock b/composer.lock index 166a6816d..284c794a4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a6d1e50f9e098a1f83afcd347490c0fe", + "content-hash": "d67659492f02bf5db84577b43f73bd50", "packages": [ { "name": "acquia/blt", @@ -371,16 +371,16 @@ }, { "name": "codechefmarc/content_access_simple", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/codechefmarc/content_access_simple.git", - "reference": "0fc77fd10f04ecf7f8dd42341ef50b45b542b07d" + "reference": "f08cf870c10bf9302b127feea65a9cfd95c6b715" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/codechefmarc/content_access_simple/zipball/0fc77fd10f04ecf7f8dd42341ef50b45b542b07d", - "reference": "0fc77fd10f04ecf7f8dd42341ef50b45b542b07d", + "url": "https://api.github.com/repos/codechefmarc/content_access_simple/zipball/f08cf870c10bf9302b127feea65a9cfd95c6b715", + "reference": "f08cf870c10bf9302b127feea65a9cfd95c6b715", "shasum": "" }, "require": { @@ -395,10 +395,10 @@ ], "description": "A simpler way to set view permissions for Content Access", "support": { - "source": "https://github.com/codechefmarc/content_access_simple/tree/1.1.1", + "source": "https://github.com/codechefmarc/content_access_simple/tree/1.1.2", "issues": "https://github.com/codechefmarc/content_access_simple/issues" }, - "time": "2024-11-14T23:21:34+00:00" + "time": "2024-11-19T02:00:54+00:00" }, { "name": "commerceguys/addressing", diff --git a/config/default/content_access_simple.settings.yml b/config/default/content_access_simple.settings.yml index 7aa30b605..fe883c1e0 100644 --- a/config/default/content_access_simple.settings.yml +++ b/config/default/content_access_simple.settings.yml @@ -1,5 +1,3 @@ -_core: - default_config_hash: QfKnBM3eY89y3dqsdVFRwG5E8H8zr3zGJyin6Bi9TJk role_config: hidden_roles: - anonymous @@ -9,3 +7,4 @@ role_config: - site_manager debug: false help_text_view: 'Only the chosen roles will be able to view this content' +unpublished_message: '' diff --git a/config/default/user.role.site_manager.yml b/config/default/user.role.site_manager.yml index 44441aba9..25ef2d61f 100644 --- a/config/default/user.role.site_manager.yml +++ b/config/default/user.role.site_manager.yml @@ -187,6 +187,7 @@ permissions: - 'edit terms in hs_person_staff_type' - 'edit terms in hs_person_student_type' - 'edit terms in hs_publication_type' + - 'grant content access simple' - 'import hs_capx migration' - 'import hs_events_importer migration' - 'manipulate entityqueues' diff --git a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install index a76200af0..d4cf8f696 100644 --- a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install +++ b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install @@ -1026,3 +1026,13 @@ function su_humsci_profile_update_9714() { $role->save(); } } + +/** + * Grants site managers access to the new content access simple module. + */ +function su_humsci_profile_update_9715() { + \Drupal::service('module_installer')->install(['content_access_simple']); + user_role_grant_permissions('site_manager', [ + 'grant content access simple' + ]); +}