diff options
Diffstat (limited to 'client/src/app/+admin/admin.component.ts')
-rw-r--r-- | client/src/app/+admin/admin.component.ts | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index b23999d40..9662522dc 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts | |||
@@ -1,12 +1,28 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { UserRight } from '../../../../shared' | 2 | import { UserRight } from '../../../../shared' |
3 | import { AuthService } from '../core/auth/auth.service' | 3 | import { AuthService } from '../core/auth/auth.service' |
4 | import { ListOverflowItem } from '@app/shared/misc/list-overflow.component' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
4 | 6 | ||
5 | @Component({ | 7 | @Component({ |
6 | templateUrl: './admin.component.html' | 8 | templateUrl: './admin.component.html' |
7 | }) | 9 | }) |
8 | export class AdminComponent { | 10 | export class AdminComponent implements OnInit { |
9 | constructor (private auth: AuthService) {} | 11 | items: ListOverflowItem[] = [] |
12 | |||
13 | constructor ( | ||
14 | private auth: AuthService, | ||
15 | private i18n: I18n | ||
16 | ) {} | ||
17 | |||
18 | ngOnInit () { | ||
19 | if (this.hasUsersRight()) this.items.push({ label: this.i18n('Users'), routerLink: '/admin/users' }) | ||
20 | if (this.hasServerFollowRight()) this.items.push({ label: this.i18n('Follows & redundancies'), routerLink: '/admin/follows' }) | ||
21 | if (this.hasVideoAbusesRight() || this.hasVideoBlacklistRight()) this.items.push({ label: this.i18n('Moderation'), routerLink: '/admin/moderation' }) | ||
22 | if (this.hasConfigRight()) this.items.push({ label: this.i18n('Configuration'), routerLink: '/admin/config' }) | ||
23 | if (this.hasPluginsRight()) this.items.push({ label: this.i18n('Plugins/Themes'), routerLink: '/admin/plugins' }) | ||
24 | if (this.hasJobsRight() || this.hasLogsRight() || this.hasDebugRight()) this.items.push({ label: this.i18n('System'), routerLink: '/admin/system' }) | ||
25 | } | ||
10 | 26 | ||
11 | hasUsersRight () { | 27 | hasUsersRight () { |
12 | return this.auth.getUser().hasRight(UserRight.MANAGE_USERS) | 28 | return this.auth.getUser().hasRight(UserRight.MANAGE_USERS) |