]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/moderation/moderation.component.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / moderation.component.ts
index 7f85f920e3d65dd14e876ffaf34cb7d76a3c4183..7744deb06ba2d768d6e332dfc7c34fa798627d98 100644 (file)
@@ -1,13 +1,24 @@
-import { Component } from '@angular/core'
+import { Component, OnInit } from '@angular/core'
 import { UserRight } from '../../../../../shared'
-import { AuthService } from '@app/core/auth/auth.service'
+import { AuthService, ServerService } from '@app/core'
 
 @Component({
   templateUrl: './moderation.component.html',
   styleUrls: [ './moderation.component.scss' ]
 })
-export class ModerationComponent {
-  constructor (private auth: AuthService) {}
+export class ModerationComponent implements OnInit {
+  autoBlacklistVideosEnabled = false
+
+  constructor (
+    private auth: AuthService,
+    private serverService: ServerService
+  ) { }
+
+  ngOnInit (): void {
+    this.serverService.getConfig()
+      .subscribe(config => this.autoBlacklistVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled)
+
+  }
 
   hasVideoAbusesRight () {
     return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
@@ -17,11 +28,11 @@ export class ModerationComponent {
     return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
   }
 
-  hasAccountsBlacklistRight () {
+  hasAccountsBlocklistRight () {
     return this.auth.getUser().hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST)
   }
 
-  hasServersBlacklistRight () {
+  hasServersBlocklistRight () {
     return this.auth.getUser().hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)
   }
 }