From 88a75636e3ed05194dbd0ff06cb980de270aba4f Mon Sep 17 00:00:00 2001 From: ekes Date: Tue, 19 Nov 2024 13:26:03 +0100 Subject: [PATCH] Add controller role to User 1 (#496) * Update composer.json (#441) * Give user 1 controller role for groups permissions. --------- Co-authored-by: Finn Lewis Co-authored-by: Stephen Cox --- localgov_microsites.install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/localgov_microsites.install b/localgov_microsites.install index 4869f77..c1b8f29 100644 --- a/localgov_microsites.install +++ b/localgov_microsites.install @@ -6,6 +6,7 @@ */ use Drupal\user\Entity\Role; +use Drupal\user\Entity\User; /** * Implements hook_install(). @@ -23,6 +24,9 @@ function localgov_microsites_install() { $role->grantPermission('administer redirects'); $role->save(); } + + $admin = User::load(1); + $admin->addRole('microsites_controller'); } /**