2017-06-16 14:32:15 +02:00
|
|
|
import { Component } from '@angular/core'
|
2017-12-08 10:41:49 +01:00
|
|
|
import { UserRight } from '../../../../shared'
|
|
|
|
import { AuthService } from '../core/auth/auth.service'
|
2016-08-09 21:45:21 +02:00
|
|
|
|
|
|
|
@Component({
|
2017-12-08 10:41:49 +01:00
|
|
|
templateUrl: './admin.component.html',
|
|
|
|
styleUrls: [ './admin.component.scss' ]
|
2016-08-09 21:45:21 +02:00
|
|
|
})
|
|
|
|
export class AdminComponent {
|
2017-12-08 10:41:49 +01:00
|
|
|
constructor (private auth: AuthService) {}
|
|
|
|
|
|
|
|
hasUsersRight () {
|
|
|
|
return this.auth.getUser().hasRight(UserRight.MANAGE_USERS)
|
|
|
|
}
|
|
|
|
|
|
|
|
hasServerFollowRight () {
|
|
|
|
return this.auth.getUser().hasRight(UserRight.MANAGE_SERVER_FOLLOW)
|
|
|
|
}
|
|
|
|
|
|
|
|
hasVideoAbusesRight () {
|
|
|
|
return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
|
|
|
|
}
|
|
|
|
|
|
|
|
hasVideoBlacklistRight () {
|
|
|
|
return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
|
|
|
|
}
|
|
|
|
|
|
|
|
hasJobsRight () {
|
|
|
|
return this.auth.getUser().hasRight(UserRight.MANAGE_JOBS)
|
|
|
|
}
|
2018-01-17 10:32:03 +01:00
|
|
|
|
|
|
|
hasConfigRight () {
|
|
|
|
return this.auth.getUser().hasRight(UserRight.MANAGE_CONFIGURATION)
|
|
|
|
}
|
2016-08-09 21:45:21 +02:00
|
|
|
}
|