]>
Commit | Line | Data |
---|---|---|
1 | import { Component, OnInit } 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 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 | } |