diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-27 16:55:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-27 16:55:03 +0200 |
commit | 954605a804da399317ca62afa2fb9244afa11ebf (patch) | |
tree | de6ee69280bfb928bc01c29430e13d5b820e921a /server/initializers/installer.ts | |
parent | e02573ad67626210ed279bad321ee139094921a1 (diff) | |
download | PeerTube-954605a804da399317ca62afa2fb9244afa11ebf.tar.gz PeerTube-954605a804da399317ca62afa2fb9244afa11ebf.tar.zst PeerTube-954605a804da399317ca62afa2fb9244afa11ebf.zip |
Support roles with rights and add moderator role
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r-- | server/initializers/installer.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 4c04290fc..077472341 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts | |||
@@ -2,10 +2,11 @@ import * as passwordGenerator from 'password-generator' | |||
2 | import * as Bluebird from 'bluebird' | 2 | import * as Bluebird from 'bluebird' |
3 | 3 | ||
4 | import { database as db } from './database' | 4 | import { database as db } from './database' |
5 | import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION, CACHE } from './constants' | 5 | import { CONFIG, LAST_MIGRATION_VERSION, CACHE } from './constants' |
6 | import { clientsExist, usersExist } from './checker' | 6 | import { clientsExist, usersExist } from './checker' |
7 | import { logger, createCertsIfNotExist, mkdirpPromise, rimrafPromise } from '../helpers' | 7 | import { logger, createCertsIfNotExist, mkdirpPromise, rimrafPromise } from '../helpers' |
8 | import { createUserAuthorAndChannel } from '../lib' | 8 | import { createUserAuthorAndChannel } from '../lib' |
9 | import { UserRole } from '../../shared' | ||
9 | 10 | ||
10 | async function installApplication () { | 11 | async function installApplication () { |
11 | await db.sequelize.sync() | 12 | await db.sequelize.sync() |
@@ -88,7 +89,7 @@ async function createOAuthAdminIfNotExist () { | |||
88 | logger.info('Creating the administrator.') | 89 | logger.info('Creating the administrator.') |
89 | 90 | ||
90 | const username = 'root' | 91 | const username = 'root' |
91 | const role = USER_ROLES.ADMIN | 92 | const role = UserRole.ADMINISTRATOR |
92 | const email = CONFIG.ADMIN.EMAIL | 93 | const email = CONFIG.ADMIN.EMAIL |
93 | let validatePassword = true | 94 | let validatePassword = true |
94 | let password = '' | 95 | let password = '' |