]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/moderation/moderation.component.ts
Refactor feed component
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / moderation.component.ts
index 7f85f920e3d65dd14e876ffaf34cb7d76a3c4183..85665ea4f9b23aa95f2a24b3e9af3693905d7446 100644 (file)
@@ -1,27 +1,19 @@
-import { Component } from '@angular/core'
-import { UserRight } from '../../../../../shared'
-import { AuthService } from '@app/core/auth/auth.service'
+import { Component, OnInit } from '@angular/core'
+import { ServerService } from '@app/core'
 
 @Component({
   templateUrl: './moderation.component.html',
-  styleUrls: [ './moderation.component.scss' ]
+  styleUrls: [ ]
 })
-export class ModerationComponent {
-  constructor (private auth: AuthService) {}
+export class ModerationComponent implements OnInit {
+  autoBlockVideosEnabled = false
 
-  hasVideoAbusesRight () {
-    return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
-  }
-
-  hasVideoBlacklistRight () {
-    return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
-  }
-
-  hasAccountsBlacklistRight () {
-    return this.auth.getUser().hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST)
-  }
+  constructor (
+    private serverService: ServerService
+  ) { }
 
-  hasServersBlacklistRight () {
-    return this.auth.getUser().hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)
+  ngOnInit (): void {
+    this.serverService.getConfig()
+      .subscribe(config => this.autoBlockVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled)
   }
 }