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