From 57c1eed524ad90e1a4a69fb0884f943370b109fd Mon Sep 17 00:00:00 2001 From: berliner Date: Fri, 15 Mar 2024 16:27:54 +0100 Subject: [PATCH] HPC-9281: Revamp of content access control. Add content space field to articles and documents (and import them from CM), add content spaces field to teams, tigh them together via node grants, also features some nice UI additions and even more restricted permissions. Extends the team page, limits data show on the team overview page and adds subpages with complete lists, UI still to be defined/improved but usable for the moment --- composer.json | 2 + composer.lock | 102 +- composer.patches.json | 6 +- ...tity_form_display.node.article.default.yml | 32 +- ...ity_form_display.node.document.default.yml | 46 +- ...orm_display.taxonomy_term.team.default.yml | 11 + ....entity_view_display.node.article.card.yml | 4 +- ...view_display.node.article.card_summary.yml | 4 +- ...tity_view_display.node.article.default.yml | 18 +- ....entity_view_display.node.article.grid.yml | 4 +- ...isplay.node.article.password_protected.yml | 2 + ...iew_display.node.article.search_result.yml | 2 + ...ntity_view_display.node.article.teaser.yml | 4 +- ...ity_view_display.node.document.default.yml | 27 +- ...splay.node.document.password_protected.yml | 2 + ...ew_display.node.document.search_result.yml | 2 + ...tity_view_display.node.document.teaser.yml | 2 + ...iew_display.taxonomy_term.team.default.yml | 109 +- ....entity_view_display.user.user.default.yml | 25 +- config/core.extension.yml | 2 + ...field.node.article.field_content_space.yml | 29 + .../field.field.node.article.field_team.yml | 29 - ...ield.node.document.field_content_space.yml | 29 + ...axonomy_term.team.field_content_spaces.yml | 29 + ...field.storage.node.field_content_space.yml | 20 + ...age.taxonomy_term.field_content_spaces.yml | 19 + ...t_settings.taxonomy_term.content_space.yml | 11 + ...ings.taxonomy_term.panopoly_categories.yml | 11 + config/language/fr/views.view.media.yml | 5 + ....migration.articles_hpc_content_module.yml | 17 + ...migration.documents_hpc_content_module.yml | 17 + ...onomy_content_space_hpc_content_module.yml | 39 + ...ings.taxonomy_vocabulary_content_space.yml | 14 + ...axonomy_vocabulary_panopoly_categories.yml | 14 + ...vior_settings.taxonomy_vocabulary_tags.yml | 14 + ...vior_settings.taxonomy_vocabulary_team.yml | 14 + config/subpathauto.settings.yml | 4 + config/taxonomy.vocabulary.cluster_tags.yml | 7 +- config/taxonomy.vocabulary.content_space.yml | 13 + ...axonomy.vocabulary.operations_category.yml | 7 +- .../taxonomy.vocabulary.organization_type.yml | 2 +- ...axonomy.vocabulary.panopoly_categories.yml | 7 +- config/taxonomy.vocabulary.plan_costing.yml | 9 +- config/taxonomy.vocabulary.plan_type.yml | 9 +- config/taxonomy.vocabulary.tags.yml | 9 +- config/taxonomy.vocabulary.team.yml | 9 +- config/user.role.administrator.yml | 29 - config/user.role.editor.yml | 22 + config/user.role.rpm_administrator.yml | 13 - config/views.view.content.yml | 246 +- config/views.view.teams.yml | 4810 ++++++++++++++++- ....migration.articles_hpc_content_module.yml | 17 + ...migration.documents_hpc_content_module.yml | 17 + ...onomy_content_space_hpc_content_module.yml | 32 + .../custom/ghi_content/ghi_content.module | 125 +- .../ghi_content/ghi_content.services.yml | 1 + .../src/ContentManager/ArticleManager.php | 3 + .../src/ContentManager/DocumentManager.php | 3 + .../ghi_content/src/Entity/ContentBase.php | 11 + .../RedirectRequestSubscriber.php | 71 +- .../ghi_content/src/Import/ImportManager.php | 53 + .../migrate/source/RemoteSourceGraphQL.php | 1 + .../src/RemoteContent/RemoteContentBase.php | 7 + .../RemoteContent/RemoteContentInterface.php | 8 + .../RemoteSourceBaseHpcContentModule.php | 28 + .../RemoteSource/RemoteSourceInterface.php | 8 + .../custom/ghi_gin/css/gin_toolbar.css | 5 +- html/modules/custom/ghi_teams/css/gin.css | 7 + .../modules/custom/ghi_teams/ghi_teams.module | 139 + .../custom/ghi_teams/ghi_teams.views.inc | 14 + .../Plugin/views/field/TeamArticleCount.php | 69 + .../Plugin/views/field/TeamDocumentCount.php | 69 + .../hpc_common/src/Helpers/RequestHelper.php | 26 + .../common_design_subtheme.theme | 11 + .../common_design_subtheme/css/styles.css | 2 +- .../sass/base/_base-layout.scss | 20 - 76 files changed, 6152 insertions(+), 508 deletions(-) create mode 100644 config/field.field.node.article.field_content_space.yml delete mode 100644 config/field.field.node.article.field_team.yml create mode 100644 config/field.field.node.document.field_content_space.yml create mode 100644 config/field.field.taxonomy_term.team.field_content_spaces.yml create mode 100644 config/field.storage.node.field_content_space.yml create mode 100644 config/field.storage.taxonomy_term.field_content_spaces.yml create mode 100644 config/language.content_settings.taxonomy_term.content_space.yml create mode 100644 config/language.content_settings.taxonomy_term.panopoly_categories.yml create mode 100644 config/migrate_plus.migration.taxonomy_content_space_hpc_content_module.yml create mode 100644 config/rabbit_hole.behavior_settings.taxonomy_vocabulary_content_space.yml create mode 100644 config/rabbit_hole.behavior_settings.taxonomy_vocabulary_panopoly_categories.yml create mode 100644 config/rabbit_hole.behavior_settings.taxonomy_vocabulary_tags.yml create mode 100644 config/rabbit_hole.behavior_settings.taxonomy_vocabulary_team.yml create mode 100644 config/subpathauto.settings.yml create mode 100644 config/taxonomy.vocabulary.content_space.yml create mode 100644 html/modules/custom/ghi_content/config/install/migrate_plus.migration.taxonomy_content_space_hpc_content_module.yml create mode 100644 html/modules/custom/ghi_teams/src/Plugin/views/field/TeamArticleCount.php create mode 100644 html/modules/custom/ghi_teams/src/Plugin/views/field/TeamDocumentCount.php diff --git a/composer.json b/composer.json index a7d6aa3d5..cbd3c6d62 100644 --- a/composer.json +++ b/composer.json @@ -78,6 +78,7 @@ "drupal/editor_advanced_link": "^2.2", "drupal/entity_access_password": "^1.0", "drupal/field_group": "^3.1", + "drupal/flat_taxonomy": "^2.0", "drupal/fpa": "^4.0.0", "drupal/gin": "^3.0-beta5", "drupal/gin_lb": "^1.0@beta", @@ -116,6 +117,7 @@ "drupal/smugmug_api": "^2.0", "drupal/social_auth_hid": "^3.2", "drupal/stage_file_proxy": "^2.0", + "drupal/subpathauto": "^1.3", "drupal/tippy": "^1.0", "drupal/username_enumeration_prevention": "^1.3", "drupal/view_unpublished": "^1.0", diff --git a/composer.lock b/composer.lock index 04b910610..033f3e449 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": "37a2d7f8ac293ee9322e859aa0ca4823", + "content-hash": "b3a7f2870be7ef34d5cd0fb94bc3ad37", "packages": [ { "name": "asm89/stack-cors", @@ -2911,6 +2911,50 @@ "source": "https://git.drupalcode.org/project/file_mdm" } }, + { + "name": "drupal/flat_taxonomy", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/flat_taxonomy.git", + "reference": "2.0.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/flat_taxonomy-2.0.0.zip", + "reference": "2.0.0", + "shasum": "b85d1bde4d8de589cd0dfc77b846e66f0906a0ce" + }, + "require": { + "drupal/core": "^8 || ^9 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "2.0.0", + "datestamp": "1688494925", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "vbouchet", + "homepage": "https://www.drupal.org/user/1671428" + } + ], + "description": "Provides tools to force selected taxonomies to be flat.", + "homepage": "https://www.drupal.org/project/flat_taxonomy", + "support": { + "source": "https://git.drupalcode.org/project/flat_taxonomy" + } + }, { "name": "drupal/fpa", "version": "4.0.0", @@ -5673,6 +5717,62 @@ "source": "https://git.drupalcode.org/project/stage_file_proxy" } }, + { + "name": "drupal/subpathauto", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/subpathauto.git", + "reference": "8.x-1.3" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/subpathauto-8.x-1.3.zip", + "reference": "8.x-1.3", + "shasum": "b94e4ec3c8dcd42aa04b6796ae48a9aa1848862d" + }, + "require": { + "drupal/core": "^8.8 || ^9 || ^10" + }, + "require-dev": { + "drupal/redirect": "*" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.3", + "datestamp": "1676316639", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Dave Reid", + "homepage": "https://www.drupal.org/user/53892" + }, + { + "name": "lauriii", + "homepage": "https://www.drupal.org/user/1078742" + }, + { + "name": "NickDickinsonWilde", + "homepage": "https://www.drupal.org/user/3094661" + } + ], + "description": "Provides support for extending sub-paths of URL aliases.", + "homepage": "https://www.drupal.org/project/subpathauto", + "support": { + "source": "https://cgit.drupalcode.org/subpathauto", + "issues": "https://www.drupal.org/project/issues/subpathauto" + } + }, { "name": "drupal/tippy", "version": "1.0", diff --git a/composer.patches.json b/composer.patches.json index 5ccfa2561..0149f0a4f 100644 --- a/composer.patches.json +++ b/composer.patches.json @@ -14,8 +14,12 @@ "drupal/autologout": { "Issue #3214958: Autologout triggered in background tab, no indication in other open tabs": "https://git.drupalcode.org/project/autologout/-/merge_requests/6.diff" }, + "drupal/flat_taxonomy": { + "Issue #3427628: Hide 'Add child' link from entity operations": "https://www.drupal.org/files/issues/2024-03-13/3427628-hide-add-child-link-2.patch" + }, "drupal/gin": { - "Issue #??: Use toolbar-bar as id for the toolbar to prevent JS errors in Drupal 10.2": "./patches/gin-toolbar-id.patch" + "Issue #??: Use toolbar-bar as id for the toolbar to prevent JS errors in Drupal 10.2": "./patches/gin-toolbar-id.patch", + "Issue #3281984: The breadcrumb shows 'Edit