]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { Component } from '@angular/core' |
04e0fc48 C |
2 | import { UserRight } from '../../../../shared' |
3 | import { AuthService } from '../core/auth/auth.service' | |
7da18e44 C |
4 | |
5 | @Component({ | |
f421fa06 | 6 | templateUrl: './admin.component.html' |
7da18e44 | 7 | }) |
7da18e44 | 8 | export class AdminComponent { |
04e0fc48 C |
9 | constructor (private auth: AuthService) {} |
10 | ||
11 | hasUsersRight () { | |
12 | return this.auth.getUser().hasRight(UserRight.MANAGE_USERS) | |
13 | } | |
14 | ||
15 | hasServerFollowRight () { | |
16 | return this.auth.getUser().hasRight(UserRight.MANAGE_SERVER_FOLLOW) | |
17 | } | |
18 | ||
19 | hasVideoAbusesRight () { | |
20 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES) | |
21 | } | |
22 | ||
23 | hasVideoBlacklistRight () { | |
24 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) | |
25 | } | |
26 | ||
5d79474c C |
27 | hasConfigRight () { |
28 | return this.auth.getUser().hasRight(UserRight.MANAGE_CONFIGURATION) | |
04e0fc48 | 29 | } |
fd206f0b | 30 | |
2c22613c C |
31 | hasLogsRight () { |
32 | return this.auth.getUser().hasRight(UserRight.MANAGE_LOGS) | |
33 | } | |
34 | ||
5d79474c C |
35 | hasJobsRight () { |
36 | return this.auth.getUser().hasRight(UserRight.MANAGE_JOBS) | |
37 | } | |
38 | ||
39 | hasDebugRight () { | |
40 | return this.auth.getUser().hasRight(UserRight.MANAGE_DEBUG) | |
fd206f0b | 41 | } |
7da18e44 | 42 | } |