Skip to content

Add controller role to User 1 #496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 19, 2024
4 changes: 4 additions & 0 deletions localgov_microsites.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use Drupal\user\Entity\Role;
use Drupal\user\Entity\User;

/**
* Implements hook_install().
Expand All @@ -23,6 +24,9 @@ function localgov_microsites_install() {
$role->grantPermission('administer redirects');
$role->save();
}

$admin = User::load(1);
$admin->addRole('microsites_controller');
}

/**
Expand Down