[CORD-1504] Handling XOSPermissionDenied errors
Change-Id: Icc1c796505207469d7416457802a3b9090031f72
diff --git a/src/app/datasources/helpers/model-discoverer.service.ts b/src/app/datasources/helpers/model-discoverer.service.ts
index 4306825..1ef2904 100644
--- a/src/app/datasources/helpers/model-discoverer.service.ts
+++ b/src/app/datasources/helpers/model-discoverer.service.ts
@@ -8,6 +8,7 @@
import {IXosConfigHelpersService} from '../../core/services/helpers/config.helpers';
import {IXosRuntimeStatesService, IXosState} from '../../core/services/runtime-states';
import {IXosModelStoreService} from '../stores/model.store';
+import {IXosAuthService} from '../rest/auth.rest';
export interface IXosModel {
name: string; // the model name
@@ -37,7 +38,8 @@
'XosRuntimeStates',
'XosNavigationService',
'XosModelStore',
- 'ngProgressFactory'
+ 'ngProgressFactory',
+ 'AuthService'
];
private xosModels: IXosModel[] = []; // list of augmented model definitions;
private xosServices: string[] = []; // list of loaded services
@@ -52,7 +54,8 @@
private XosRuntimeStates: IXosRuntimeStatesService,
private XosNavigationService: IXosNavigationService,
private XosModelStore: IXosModelStoreService,
- private ngProgressFactory: any // check for type defs
+ private ngProgressFactory: any, // check for type defs
+ private AuthService: IXosAuthService
) {
this.progressBar = this.ngProgressFactory.createInstance();
this.progressBar.setColor('#f6a821');
@@ -236,6 +239,7 @@
return d.resolve(model);
},
err => {
+ this.AuthService.handleUnauthenticatedRequest(err);
return d.reject(err);
}
);