Loading core/modules/dblog/tests/src/Functional/DbLogTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ protected function setUp(): void { $this->adminUser = $this->drupalCreateUser([ 'administer site configuration', 'access administration pages', 'access help pages', 'access site reports', 'administer users', ]); Loading core/modules/field/tests/src/Functional/FieldHelpTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ protected function setUp(): void { // Create the admin user. $this->adminUser = $this->drupalCreateUser([ 'access administration pages', 'access help pages', 'view the administration theme', ]); } Loading core/modules/forum/tests/src/Functional/ForumTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ protected function setUp(): void { // Create users. $this->adminUser = $this->drupalCreateUser([ 'access administration pages', 'access help pages', 'administer modules', 'administer blocks', 'administer forums', Loading @@ -107,6 +108,7 @@ protected function setUp(): void { ]); $this->editAnyTopicsUser = $this->drupalCreateUser([ 'access administration pages', 'access help pages', 'create forum content', 'edit any forum content', 'delete any forum content', Loading core/modules/help/help.permissions.yml 0 → 100644 +2 −0 Original line number Diff line number Diff line access help pages: title: 'Use help pages' core/modules/help/help.post_update.php +15 −0 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ * Post update functions for the Help module. */ use Drupal\Core\Config\Entity\ConfigEntityUpdater; use Drupal\search\Entity\SearchPage; use Drupal\user\RoleInterface; /** * Install or update config for help topics if the search module installed. Loading Loading @@ -95,3 +97,16 @@ function help_post_update_help_topics_uninstall() { \Drupal::service('module_installer')->uninstall(['help_topics'], FALSE); } } /** * Grant all admin roles the 'access help pages' permission. */ function help_post_update_add_permissions_to_roles(?array &$sandbox = []): void { \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'user_role', function (RoleInterface $role): bool { if ($role->isAdmin() || !$role->hasPermission('access administration pages')) { return FALSE; } $role->grantPermission('access help pages'); return TRUE; }); } Loading
core/modules/dblog/tests/src/Functional/DbLogTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ protected function setUp(): void { $this->adminUser = $this->drupalCreateUser([ 'administer site configuration', 'access administration pages', 'access help pages', 'access site reports', 'administer users', ]); Loading
core/modules/field/tests/src/Functional/FieldHelpTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ protected function setUp(): void { // Create the admin user. $this->adminUser = $this->drupalCreateUser([ 'access administration pages', 'access help pages', 'view the administration theme', ]); } Loading
core/modules/forum/tests/src/Functional/ForumTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ protected function setUp(): void { // Create users. $this->adminUser = $this->drupalCreateUser([ 'access administration pages', 'access help pages', 'administer modules', 'administer blocks', 'administer forums', Loading @@ -107,6 +108,7 @@ protected function setUp(): void { ]); $this->editAnyTopicsUser = $this->drupalCreateUser([ 'access administration pages', 'access help pages', 'create forum content', 'edit any forum content', 'delete any forum content', Loading
core/modules/help/help.permissions.yml 0 → 100644 +2 −0 Original line number Diff line number Diff line access help pages: title: 'Use help pages'
core/modules/help/help.post_update.php +15 −0 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ * Post update functions for the Help module. */ use Drupal\Core\Config\Entity\ConfigEntityUpdater; use Drupal\search\Entity\SearchPage; use Drupal\user\RoleInterface; /** * Install or update config for help topics if the search module installed. Loading Loading @@ -95,3 +97,16 @@ function help_post_update_help_topics_uninstall() { \Drupal::service('module_installer')->uninstall(['help_topics'], FALSE); } } /** * Grant all admin roles the 'access help pages' permission. */ function help_post_update_add_permissions_to_roles(?array &$sandbox = []): void { \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'user_role', function (RoleInterface $role): bool { if ($role->isAdmin() || !$role->hasPermission('access administration pages')) { return FALSE; } $role->grantPermission('access help pages'); return TRUE; }); }