]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/users/user-edit/user-create.component.ts
Moderators can only manage users
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / users / user-edit / user-create.component.ts
index 137ecfcbddc1c7d51d995f3458e7c34c715afe9f..3b57a49c6df07ecd722e108ed844c9ef9f32506e 100644 (file)
@@ -1,6 +1,6 @@
 import { Component, OnInit } from '@angular/core'
 import { Router } from '@angular/router'
-import { Notifier, ServerService } from '@app/core'
+import { AuthService, Notifier, ServerService } from '@app/core'
 import { UserCreate, UserRole } from '../../../../../../shared'
 import { UserEdit } from './user-edit'
 import { I18n } from '@ngx-translate/i18n-polyfill'
@@ -21,6 +21,7 @@ export class UserCreateComponent extends UserEdit implements OnInit {
     protected serverService: ServerService,
     protected formValidatorService: FormValidatorService,
     protected configService: ConfigService,
+    protected auth: AuthService,
     private userValidatorsService: UserValidatorsService,
     private router: Router,
     private notifier: Notifier,
@@ -45,7 +46,8 @@ export class UserCreateComponent extends UserEdit implements OnInit {
       password: this.userValidatorsService.USER_PASSWORD,
       role: this.userValidatorsService.USER_ROLE,
       videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA,
-      videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY
+      videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY,
+      byPassAutoBlacklist: null
     }, defaultValues)
   }
 
@@ -54,8 +56,11 @@ export class UserCreateComponent extends UserEdit implements OnInit {
 
     const userCreate: UserCreate = this.form.value
 
+    userCreate.adminFlags = this.buildAdminFlags(this.form.value)
+
     // A select in HTML is always mapped as a string, we convert it to number
     userCreate.videoQuota = parseInt(this.form.value['videoQuota'], 10)
+    userCreate.videoQuotaDaily = parseInt(this.form.value['videoQuotaDaily'], 10)
 
     this.userService.addUser(userCreate).subscribe(
       () => {