X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fadmin.component.ts;h=1a4dd67862d96460b57f1b24db192f9420171bfe;hb=b014b6b9c7cb68d09c52b44046afe486c0736426;hp=64a7400e7e954d5c8d3660a054b7c2c06cb132e7;hpb=b99290b1d5d736083513fb8f66e91f61bfe07e0b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index 64a7400e7..1a4dd6786 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts @@ -1,8 +1,35 @@ -import { Component } from '@angular/core'; +import { Component } from '@angular/core' +import { UserRight } from '../../../../shared' +import { AuthService } from '../core/auth/auth.service' @Component({ - template: '' + templateUrl: './admin.component.html', + styleUrls: [ './admin.component.scss' ] }) - export class AdminComponent { + 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) + } }