Merge branch 'release/v1.0.0' 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   styleUrls: [ './admin.component.scss' ]
8 })
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   }
31
32   hasConfigRight () {
33     return this.auth.getUser().hasRight(UserRight.MANAGE_CONFIGURATION)
34   }
35 }