]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/moderation/moderation.component.ts
806f9d100a81f56622717e13f088ebeb375e01f2
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / moderation.component.ts
1 import { Component, OnInit } from '@angular/core'
2 import { AuthService, ServerService } from '@app/core'
3 import { UserRight } from '@shared/models'
4
5 @Component({
6 templateUrl: './moderation.component.html',
7 styleUrls: [ './moderation.component.scss' ]
8 })
9 export class ModerationComponent implements OnInit {
10 autoBlockVideosEnabled = false
11
12 constructor (
13 private auth: AuthService,
14 private serverService: ServerService
15 ) { }
16
17 ngOnInit (): void {
18 this.serverService.getConfig()
19 .subscribe(config => this.autoBlockVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled)
20
21 }
22
23 hasVideoAbusesRight () {
24 return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
25 }
26
27 hasVideoBlocklistRight () {
28 return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
29 }
30
31 hasAccountsBlocklistRight () {
32 return this.auth.getUser().hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST)
33 }
34
35 hasServersBlocklistRight () {
36 return this.auth.getUser().hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)
37 }
38 }