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

36 lines
916 B
TypeScript
Raw Normal View History

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)
}
hasConfigRight () {
return this.auth.getUser().hasRight(UserRight.MANAGE_CONFIGURATION)
}
2016-08-09 21:45:21 +02:00
}