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