@@ -5,9 +5,7 @@ import { PermissionType } from "@app/admin/permission/permission.model";
55import { AuthService , CurrentUserInfoResponse } from "@app/auth/auth.service" ;
66import { faSignInAlt } from "@fortawesome/free-solid-svg-icons" ;
77import { TranslateService } from "@ngx-translate/core" ;
8- import { User } from "@shared/components/forms/form-body-application/form-body-application.component" ;
98import { OrganizationAccessScope } from "@shared/enums/access-scopes" ;
10- import { LoggedInService } from "@shared/services/loggedin.service" ;
119import { MeService } from "@shared/services/me.service" ;
1210import { SharedVariableService } from "@shared/shared-variable/shared-variable.service" ;
1311import { UserResponse } from "./../admin/users/user.model" ;
@@ -26,7 +24,6 @@ export class NavbarComponent implements OnInit {
2624 public isOnlyGatewayAdmin = false ;
2725
2826 isCollapsed = false ;
29- user : User ;
3027
3128 userInfo : CurrentUserInfoResponse ;
3229 faSignInAlt = faSignInAlt ;
@@ -35,9 +32,7 @@ export class NavbarComponent implements OnInit {
3532 constructor (
3633 private authService : AuthService ,
3734 public translate : TranslateService ,
38- private router : Router ,
3935 private sharedVariableService : SharedVariableService ,
40- private loggedInService : LoggedInService ,
4136 private meService : MeService ,
4237 private route : Router
4338 ) {
@@ -97,9 +92,7 @@ export class NavbarComponent implements OnInit {
9792 OrganizationAccessScope . UserAdministrationWrite ,
9893 orgId
9994 ) ;
100- this . isGlobalAdmin = this . userResponse ?. permissions ?. some ( ( { type : pmTypes } ) =>
101- pmTypes . some ( pmType => pmType . type === PermissionType . GlobalAdmin )
102- ) ;
95+ this . isGlobalAdmin = this . meService . hasGlobalAdmin ( ) ;
10396 this . isOnlyGatewayAdmin = this . userResponse . permissions . every ( ( { type : pmTypes } ) =>
10497 pmTypes . some ( pmType => pmType . type === PermissionType . OrganizationGatewayAdmin )
10598 ) ;
0 commit comments