]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - 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
1import { Component, OnInit } from '@angular/core'
2import { UserRight } from '../../../../../shared'
3import { AuthService, ServerService } from '@app/core'
4
5@Component({
6 templateUrl: './moderation.component.html',
7 styleUrls: [ './moderation.component.scss' ]
8})
9export class ModerationComponent implements OnInit {
10 autoBlacklistVideosEnabled = 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.autoBlacklistVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled)
20
21 }
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 }
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}