Skip to content

Commit 03947a3

Browse files
committed
[LM-46] added furthe check for login miur
1 parent b5e821f commit 03947a3

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/app/menu.resolver.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,14 +619,15 @@ export class MenuResolver implements Resolve<boolean> {
619619
createDLExporterMenuItem() {
620620
observableCombineLatest([
621621
this.authorizationService.isAuthorized(FeatureID.AdministratorOf),
622-
this.getDLExporterURL()
623-
]).subscribe(([authorized, url]) => {
622+
this.getDLExporterURL(),
623+
this.getDLExporterAccessToken()
624+
]).subscribe(([authorized, url, accesstoken]) => {
624625
this.menuService.addSection(MenuID.ADMIN,
625626
{
626627
id: 'loginmiur_dlexporter_url',
627628
index: 15,
628629
active: false,
629-
visible: authorized && (hasValue(url) && url.length > 0),
630+
visible: authorized && (hasValue(url) && url.length > 0) && (hasValue(accesstoken) && accesstoken.length > 0),
630631
model: {
631632
type: MenuItemType.LINK,
632633
text: 'menu.section.loginmiur_dlexporter_url',
@@ -1017,4 +1018,13 @@ export class MenuResolver implements Resolve<boolean> {
10171018
})
10181019
);
10191020
}
1021+
1022+
private getDLExporterAccessToken() {
1023+
return this.configService.findByPropertyName('loginmiur.dlexporter.accesstoken').pipe(
1024+
getFirstCompletedRemoteData(),
1025+
map((res: RemoteData<ConfigurationProperty>) => {
1026+
return res?.payload?.values[0];
1027+
})
1028+
);
1029+
}
10201030
}

0 commit comments

Comments
 (0)