diff options
Diffstat (limited to 'client/src/app/+admin/admin.component.ts')
-rw-r--r-- | client/src/app/+admin/admin.component.ts | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index ecd62ee61..75cd50cc7 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts | |||
@@ -1,7 +1,31 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component } from '@angular/core' |
2 | import { UserRight } from '../../../../shared' | ||
3 | import { AuthService } from '../core/auth/auth.service' | ||
2 | 4 | ||
3 | @Component({ | 5 | @Component({ |
4 | template: '<router-outlet></router-outlet>' | 6 | templateUrl: './admin.component.html', |
7 | styleUrls: [ './admin.component.scss' ] | ||
5 | }) | 8 | }) |
6 | export class AdminComponent { | 9 | export class AdminComponent { |
10 | constructor (private auth: AuthService) {} | ||
11 | |||
12 | hasUsersRight () { | ||
13 | return this.auth.getUser().hasRight(UserRight.MANAGE_USERS) | ||
14 | } | ||
15 | |||
16 | hasServerFollowRight () { | ||
17 | return this.auth.getUser().hasRight(UserRight.MANAGE_SERVER_FOLLOW) | ||
18 | } | ||
19 | |||
20 | hasVideoAbusesRight () { | ||
21 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES) | ||
22 | } | ||
23 | |||
24 | hasVideoBlacklistRight () { | ||
25 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) | ||
26 | } | ||
27 | |||
28 | hasJobsRight () { | ||
29 | return this.auth.getUser().hasRight(UserRight.MANAGE_JOBS) | ||
30 | } | ||
7 | } | 31 | } |