]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/moderation/moderation.component.ts
Add ability to report account
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / moderation.component.ts
index 47154af3ffb6cd53b7ff9aef2547d92ee9002b82..b0f5eb2243cb86e546422413318bc117145fbc0f 100644 (file)
@@ -1,34 +1,19 @@
-import { Component } from '@angular/core'
-import { UserRight } from '../../../../../shared'
-import { AuthService, ServerService } from '@app/core'
+import { Component, OnInit } from '@angular/core'
+import { ServerService } from '@app/core'
 
 @Component({
   templateUrl: './moderation.component.html',
   styleUrls: [ './moderation.component.scss' ]
 })
-export class ModerationComponent {
-  autoBlacklistVideosEnabled: boolean
+export class ModerationComponent implements OnInit {
+  autoBlockVideosEnabled = false
 
   constructor (
-    private auth: AuthService,
     private serverService: ServerService
-  ) {
-    this.autoBlacklistVideosEnabled = this.serverService.getConfig().autoBlacklist.videos.ofUsers.enabled
-  }
-
-  hasVideoAbusesRight () {
-    return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
-  }
-
-  hasVideoBlacklistRight () {
-    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)
+  ngOnInit (): void {
+    this.serverService.getConfig()
+      .subscribe(config => this.autoBlockVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled)
   }
 }