diff options
Diffstat (limited to 'client/src/app/core/menu/menu-admin.component.ts')
-rw-r--r-- | client/src/app/core/menu/menu-admin.component.ts | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/client/src/app/core/menu/menu-admin.component.ts b/client/src/app/core/menu/menu-admin.component.ts index f6cc6554c..074f1dbaf 100644 --- a/client/src/app/core/menu/menu-admin.component.ts +++ b/client/src/app/core/menu/menu-admin.component.ts | |||
@@ -1,8 +1,33 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component } from '@angular/core' |
2 | 2 | ||
3 | import { AuthService } from '../auth/auth.service' | ||
4 | import { UserRight } from '../../../../../shared' | ||
5 | |||
3 | @Component({ | 6 | @Component({ |
4 | selector: 'my-menu-admin', | 7 | selector: 'my-menu-admin', |
5 | templateUrl: './menu-admin.component.html', | 8 | templateUrl: './menu-admin.component.html', |
6 | styleUrls: [ './menu.component.scss' ] | 9 | styleUrls: [ './menu.component.scss' ] |
7 | }) | 10 | }) |
8 | export class MenuAdminComponent { } | 11 | export class MenuAdminComponent { |
12 | constructor (private auth: AuthService) {} | ||
13 | |||
14 | hasUsersRight () { | ||
15 | return this.auth.getUser().hasRight(UserRight.MANAGE_USERS) | ||
16 | } | ||
17 | |||
18 | hasFriendsRight () { | ||
19 | return this.auth.getUser().hasRight(UserRight.MANAGE_PODS) | ||
20 | } | ||
21 | |||
22 | hasRequestsStatRight () { | ||
23 | return this.auth.getUser().hasRight(UserRight.MANAGE_REQUEST_SCHEDULERS) | ||
24 | } | ||
25 | |||
26 | hasVideoAbusesRight () { | ||
27 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES) | ||
28 | } | ||
29 | |||
30 | hasVideoBlacklistRight () { | ||
31 | return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) | ||
32 | } | ||
33 | } | ||