forked from goalgorilla/open_social
-
Notifications
You must be signed in to change notification settings - Fork 0
/
social.install
38 lines (32 loc) · 867 Bytes
/
social.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* @file
* Install, update and uninstall functions for the social installation profile.
*/
use Drupal\user\Entity\User;
use Drupal\user\Entity\Role;
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function social_install() {
\Drupal::configFactory()
->getEditable('system.site')
->set('page.front', '/stream')
->save(TRUE);
// Assign user 1 the "administrator" role.
$user = User::load(1);
$user->roles[] = 'administrator';
$user->save();
// Create the content manager role.
$data = array('id' => 'contentmanager', 'label' => 'Content manager');
$role = Role::create($data);
$role->save();
// Create the site manager role.
$data = array('id' => 'sitemanager', 'label' => 'Site manager');
$role = Role::create($data);
$role->save();
}