protected function createAdminRole($rid = NULL,
$name = NULL,
$weight = NULL
) { $rid =
$this->
createRole([],
$rid,
$name,
$weight);
if ($rid) { /** @var \Drupal\user\RoleInterface $role */
$role = Role::
load($rid);
$role->
setIsAdmin(TRUE
);
$role->
save();
} return $rid;
} /**
* Creates a role with specified permissions.
*
* @param array $permissions
* Array of permission names to assign to role.
* @param string $rid
* (optional) The role ID (machine name). Defaults to a random name.
* @param string $name
* (optional) The label for the role. Defaults to a random string.
* @param int $weight
* (optional) The weight for the role. Defaults to NULL which sets the
* weight to maximum + 1.
*
* @return string
* Role ID of newly created role, or FALSE if role creation failed.
*/