Merge branch 'checkbox-input-plugin' into 'develop'
[oweals/peertube.git] / client / src / app / +admin / admin.component.ts
1 import { Component } from '@angular/core'
2 import { UserRight } from '../../../../shared'
3 import { AuthService } from '../core/auth/auth.service'
4
5 @Component({
6   templateUrl: './admin.component.html'
7 })
8 export class AdminComponent {
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
27   hasConfigRight () {
28     return this.auth.getUser().hasRight(UserRight.MANAGE_CONFIGURATION)
29   }
30
31   hasPluginsRight () {
32     return this.auth.getUser().hasRight(UserRight.MANAGE_PLUGINS)
33   }
34
35   hasLogsRight () {
36     return this.auth.getUser().hasRight(UserRight.MANAGE_LOGS)
37   }
38
39   hasJobsRight () {
40     return this.auth.getUser().hasRight(UserRight.MANAGE_JOBS)
41   }
42
43   hasDebugRight () {
44     return this.auth.getUser().hasRight(UserRight.MANAGE_DEBUG)
45   }
46 }