]>
Commit | Line | Data |
---|---|---|
ba430d75 | 1 | import { Component, OnInit } from '@angular/core' |
7ccddd7b | 2 | import { AuthService, ServerService } from '@app/core' |
67ed6552 | 3 | import { UserRight } from '@shared/models' |
614d1ae9 C |
4 | |
5 | @Component({ | |
6 | templateUrl: './moderation.component.html', | |
7 | styleUrls: [ './moderation.component.scss' ] | |
8 | }) | |
ba430d75 | 9 | export class ModerationComponent implements OnInit { |
5baee5fc | 10 | autoBlockVideosEnabled = 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() | |
5baee5fc | 19 | .subscribe(config => this.autoBlockVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled) |
ba430d75 | 20 | |
7ccddd7b | 21 | } |
614d1ae9 C |
22 | |
23 | hasVideoAbusesRight () { | |
24 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES) | |
25 | } | |
26 | ||
5baee5fc | 27 | hasVideoBlocklistRight () { |
3487330d | 28 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) |
614d1ae9 | 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 | } |