diff options
Diffstat (limited to 'client/src/app/+admin/moderation')
-rw-r--r-- | client/src/app/+admin/moderation/moderation.component.html | 14 | ||||
-rw-r--r-- | client/src/app/+admin/moderation/moderation.component.ts | 21 |
2 files changed, 1 insertions, 34 deletions
diff --git a/client/src/app/+admin/moderation/moderation.component.html b/client/src/app/+admin/moderation/moderation.component.html index 7bab63c33..90c6b6463 100644 --- a/client/src/app/+admin/moderation/moderation.component.html +++ b/client/src/app/+admin/moderation/moderation.component.html | |||
@@ -1,15 +1 @@ | |||
1 | <div class="admin-sub-header"> | ||
2 | <h1 i18n class="form-sub-title">Moderation</h1> | ||
3 | |||
4 | <div class="admin-sub-nav"> | ||
5 | <a *ngIf="hasVideoAbusesRight()" i18n routerLink="video-abuses/list" routerLinkActive="active">Video reports</a> | ||
6 | |||
7 | <a *ngIf="hasVideoBlocklistRight()" i18n routerLink="video-blocks/list" routerLinkActive="active">Video blocks</a> | ||
8 | |||
9 | <a *ngIf="hasAccountsBlocklistRight()" i18n routerLink="blocklist/accounts" routerLinkActive="active">Muted accounts</a> | ||
10 | |||
11 | <a *ngIf="hasServersBlocklistRight()" i18n routerLink="blocklist/servers" routerLinkActive="active">Muted servers</a> | ||
12 | </div> | ||
13 | </div> | ||
14 | |||
15 | <router-outlet></router-outlet> \ No newline at end of file | <router-outlet></router-outlet> \ No newline at end of file | |
diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts index 806f9d100..b0f5eb224 100644 --- a/client/src/app/+admin/moderation/moderation.component.ts +++ b/client/src/app/+admin/moderation/moderation.component.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { AuthService, ServerService } from '@app/core' | 2 | import { ServerService } from '@app/core' |
3 | import { UserRight } from '@shared/models' | ||
4 | 3 | ||
5 | @Component({ | 4 | @Component({ |
6 | templateUrl: './moderation.component.html', | 5 | templateUrl: './moderation.component.html', |
@@ -10,29 +9,11 @@ export class ModerationComponent implements OnInit { | |||
10 | autoBlockVideosEnabled = false | 9 | autoBlockVideosEnabled = false |
11 | 10 | ||
12 | constructor ( | 11 | constructor ( |
13 | private auth: AuthService, | ||
14 | private serverService: ServerService | 12 | private serverService: ServerService |
15 | ) { } | 13 | ) { } |
16 | 14 | ||
17 | ngOnInit (): void { | 15 | ngOnInit (): void { |
18 | this.serverService.getConfig() | 16 | this.serverService.getConfig() |
19 | .subscribe(config => this.autoBlockVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled) | 17 | .subscribe(config => this.autoBlockVideosEnabled = config.autoBlacklist.videos.ofUsers.enabled) |
20 | |||
21 | } | ||
22 | |||
23 | hasVideoAbusesRight () { | ||
24 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES) | ||
25 | } | ||
26 | |||
27 | hasVideoBlocklistRight () { | ||
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 | } | 18 | } |
38 | } | 19 | } |