PeerTube/client/src/app/+admin/admin.component.ts

39 lines
961 B
TypeScript
Raw Normal View History

import { Component } from '@angular/core'
2017-12-08 03:41:49 -06:00
import { UserRight } from '../../../../shared'
import { AuthService } from '../core/auth/auth.service'
2016-08-09 14:45:21 -05:00
@Component({
2019-04-02 10:39:21 -05:00
templateUrl: './admin.component.html'
2016-08-09 14:45:21 -05:00
})
export class AdminComponent {
2017-12-08 03:41:49 -06: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)
}
2019-04-11 03:05:43 -05:00
hasLogsRight () {
return this.auth.getUser().hasRight(UserRight.MANAGE_LOGS)
}
hasConfigRight () {
return this.auth.getUser().hasRight(UserRight.MANAGE_CONFIGURATION)
}
2016-08-09 14:45:21 -05:00
}