]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/moderation/moderation.component.ts
Add client helpers to plugins
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / moderation.component.ts
CommitLineData
614d1ae9
C
1import { Component } from '@angular/core'
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})
9export class ModerationComponent {
7ccddd7b
JM
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 }
614d1ae9
C
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 }
65b21c96 26
92ea70a7 27 hasAccountsBlocklistRight () {
65b21c96
C
28 return this.auth.getUser().hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST)
29 }
30
92ea70a7 31 hasServersBlocklistRight () {
65b21c96
C
32 return this.auth.getUser().hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)
33 }
614d1ae9 34}