predefined report reasons & improved reporter UI (#2842)
[oweals/peertube.git] / client / src / app / +admin / moderation / moderation.component.ts
index 0f4efb970177f0fec0f76ecf30ba02acff059b89..1b1df6f09a17fe0693be09f0d612c4eaaab35e9e 100644 (file)
@@ -1,19 +1,38 @@
-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 {
+  autoBlockVideosEnabled = false
+
+  constructor (
+    private auth: AuthService,
+    private serverService: ServerService
+  ) { }
+
+  ngOnInit (): void {
+    this.serverService.getConfig()
+      .subscribe(config => this.autoBlockVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled)
+
+  }
 
   hasVideoAbusesRight () {
     return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
   }
 
-  hasVideoBlacklistRight () {
+  hasVideoBlocklistRight () {
     return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
   }
+
+  hasAccountsBlocklistRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST)
+  }
+
+  hasServersBlocklistRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)
+  }
 }