]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/menu/menu-admin.component.ts
Change video spinner
[github/Chocobozzz/PeerTube.git] / client / src / app / core / menu / menu-admin.component.ts
index 59ffccf9f6c9658689e257e88bd61672fd81b5d6..074f1dbaf26c0a5b777555c1e1ba1f7f6f67e775 100644 (file)
@@ -1,7 +1,33 @@
-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'
+  templateUrl: './menu-admin.component.html',
+  styleUrls: [ './menu.component.scss' ]
 })
-export class MenuAdminComponent { }
+export class MenuAdminComponent {
+  constructor (private auth: AuthService) {}
+
+  hasUsersRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_USERS)
+  }
+
+  hasFriendsRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_PODS)
+  }
+
+  hasRequestsStatRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_REQUEST_SCHEDULERS)
+  }
+
+  hasVideoAbusesRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
+  }
+
+  hasVideoBlacklistRight () {
+    return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
+  }
+}