File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/app/navbar/organisation-dropdown Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 2525 </ a >
2626 < fa-icon [icon] ="faBurn " class ="navbar-icon "> </ fa-icon >
2727 </ li >
28- < div *ngIf ="user && isOrgAdmin ">
28+ < div *ngIf ="user && isOrgAdmin && !isGlobalAdmin ">
2929 < li class ="nav-item ">
3030 < a routerLink ="/admin/users " routerLinkActive ="active " class ="nav-link pl-5 position-relative rounded ">
3131 {{'NAV.USERS' | translate}}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export class OrganisationDropdownComponent implements OnInit {
1616 public organisations : Organisation [ ] ;
1717 public user : UserResponse ;
1818 public isOrgAdmin = false ;
19+ public isGlobalAdmin = false ;
1920
2021 faExchangeAlt = faExchangeAlt ;
2122 faLayergroup = faLayerGroup ;
@@ -49,16 +50,17 @@ export class OrganisationDropdownComponent implements OnInit {
4950 ) {
5051 this . setSelectedOrganisation ( userInfo . organizations [ 0 ] ?. id ) ;
5152 }
52- this . isOrganisationAdmin ( userInfo . organizations [ 0 ] ?. id ) ;
53+ this . setLocalPermissionCheck ( userInfo . organizations [ 0 ] ?. id ) ;
5354 }
5455
55- private isOrganisationAdmin ( orgId : number ) {
56+ private setLocalPermissionCheck ( orgId : number ) {
5657 this . isOrgAdmin = this . user ?. permissions ?. some ( x => x . type == PermissionType . OrganizationAdmin && x . organization . id === + orgId ) ;
58+ this . isGlobalAdmin = this . user ?. permissions ?. some ( permission => permission . type === PermissionType . GlobalAdmin ) ;
5759 }
5860
5961 public onChange ( organizationId : string ) {
6062 this . sharedVariableService . setValue ( + organizationId ) ;
61- this . isOrganisationAdmin ( + organizationId ) ;
63+ this . setLocalPermissionCheck ( + organizationId ) ;
6264 this . route . navigateByUrl ( '/' , { skipLocationChange : true } ) . then ( ( ) =>
6365 this . route . navigate ( [ 'applications' ] ) ) ;
6466 }
You can’t perform that action at this time.
0 commit comments