]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/admin.component.ts
Fix angular 9 build
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / admin.component.ts
index 64a7400e7e954d5c8d3660a054b7c2c06cb132e7..b23999d404654c8306f34c8e44f47b342c21eb64 100644 (file)
@@ -1,8 +1,46 @@
-import { Component } from '@angular/core';
+import { Component } from '@angular/core'
+import { UserRight } from '../../../../shared'
+import { AuthService } from '../core/auth/auth.service'
 
 @Component({
-  template: '<router-outlet></router-outlet>'
+  templateUrl: './admin.component.html'
 })
-
 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)
+  }
+
+  hasConfigRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_CONFIGURATION)
+  }
+
+  hasPluginsRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_PLUGINS)
+  }
+
+  hasLogsRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_LOGS)
+  }
+
+  hasJobsRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_JOBS)
+  }
+
+  hasDebugRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_DEBUG)
+  }
 }