]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/menu/menu-admin.component.ts
Add follow tabs
[github/Chocobozzz/PeerTube.git] / client / src / app / core / menu / menu-admin.component.ts
index a3d920fdda27b05bdfe2862127867b3cdb152171..88a654d1fd000ff533a6eaa7f7c26d3cea085050 100644 (file)
@@ -1,8 +1,29 @@
-import { Component } from '@angular/core';
+import { Component } from '@angular/core'
+
+import { AuthService } from '../auth/auth.service'
+import { UserRight } from '../../../../../shared'
 
 @Component({
   selector: 'my-menu-admin',
   templateUrl: './menu-admin.component.html',
-  styleUrls: [ './menu-admin.component.scss' ]
+  styleUrls: [ './menu.component.scss' ]
 })
-export class MenuAdminComponent { }
+export class MenuAdminComponent {
+  constructor (private auth: AuthService) {}
+
+  hasUsersRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_USERS)
+  }
+
+  hasApplicationFollowRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_APPLICATION_FOLLOW)
+  }
+
+  hasVideoAbusesRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
+  }
+
+  hasVideoBlacklistRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
+  }
+}