@fluxhub/fluxhub-lib 1.0.196 → 1.0.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/fluxhub-fluxhub-lib.umd.js +60 -28
- package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
- package/esm2015/lib/auth_guard.js +58 -26
- package/esm2015/lib/services/utility.service.js +1 -2
- package/esm5/lib/auth_guard.js +57 -25
- package/esm5/lib/services/utility.service.js +1 -2
- package/fesm2015/fluxhub-fluxhub-lib.js +59 -27
- package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
- package/fesm5/fluxhub-fluxhub-lib.js +58 -26
- package/fesm5/fluxhub-fluxhub-lib.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ import 'ng2-ckeditor/lib/src/ckeditor.component';
|
|
|
15
15
|
import { __read, __extends } from 'tslib';
|
|
16
16
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
17
17
|
import NavigatedViewer from 'bpmn-js/lib/NavigatedViewer';
|
|
18
|
+
import { Observable } from 'rxjs';
|
|
18
19
|
import { catchError, map, flatMap } from 'rxjs/operators';
|
|
19
20
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
20
21
|
import { MarkdownModule } from 'ngx-markdown';
|
|
@@ -32,11 +33,10 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
32
33
|
import { DragulaService, DragulaModule } from 'ng2-dragula';
|
|
33
34
|
import { MatDialogRef, MatDialog, DateAdapter, MAT_DATE_LOCALE, MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatPaginatorModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSortModule, MatSlideToggleModule, MatSnackBarModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatFormFieldModule, MatExpansionModule, MatStepperModule, MatDialogModule, MatNativeDateModule } from '@angular/material';
|
|
34
35
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
35
|
-
import { Injectable, Component, Input, Output, EventEmitter, Directive, forwardRef, ViewChild, Inject, PLATFORM_ID, ElementRef, Pipe, ViewContainerRef, defineInjectable,
|
|
36
|
+
import { Injectable, Component, Input, Output, EventEmitter, Directive, forwardRef, ViewChild, Inject, PLATFORM_ID, ElementRef, Pipe, ViewContainerRef, defineInjectable, NgModule, inject, HostListener } from '@angular/core';
|
|
36
37
|
import { Http } from '@angular/http';
|
|
37
38
|
import { SlimLoadingBarService } from 'ng2-slim-loading-bar';
|
|
38
39
|
import { ToastrService } from 'ngx-toastr';
|
|
39
|
-
import { Observable, of } from 'rxjs';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @fileoverview added by tsickle
|
|
@@ -1314,7 +1314,6 @@ var UtilityService = /** @class */ (function () {
|
|
|
1314
1314
|
*/
|
|
1315
1315
|
function (s, b_check_admin) {
|
|
1316
1316
|
if (b_check_admin === void 0) { b_check_admin = true; }
|
|
1317
|
-
console.log('check role ', this.app_s);
|
|
1318
1317
|
if (this.app_s.user_roles === null)
|
|
1319
1318
|
return false;
|
|
1320
1319
|
if (b_check_admin)
|
|
@@ -15950,51 +15949,84 @@ var FHGuard = /** @class */ (function () {
|
|
|
15950
15949
|
if (this.auth.checkCredentials()) {
|
|
15951
15950
|
if (this.routingDestination == 'home')
|
|
15952
15951
|
return true;
|
|
15953
|
-
|
|
15954
|
-
|
|
15952
|
+
console.log('canActivate 1');
|
|
15953
|
+
if (this.app_s.user_isadmin != null)
|
|
15954
|
+
if (this.app_s.user_isadmin == "1")
|
|
15955
15955
|
return true;
|
|
15956
15956
|
return new Promise(function (resolve) {
|
|
15957
|
+
console.log('canActivate 2');
|
|
15957
15958
|
if (_this.arr_accessi != null) {
|
|
15959
|
+
console.log('canActivate 3');
|
|
15958
15960
|
for (var i = 0; i < _this.arr_accessi.length; i++) {
|
|
15959
15961
|
if (_this.arr_accessi[i].type == 'M')
|
|
15960
15962
|
if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
|
|
15961
|
-
console.log(typeof (of(true)));
|
|
15962
|
-
console.log('OBS3 ' + true);
|
|
15963
15963
|
resolve(true);
|
|
15964
15964
|
return;
|
|
15965
15965
|
}
|
|
15966
15966
|
}
|
|
15967
|
-
|
|
15967
|
+
console.log('canActivate 4');
|
|
15968
|
+
_this.toast.error("ACCESS DENIED [0X0003]");
|
|
15968
15969
|
_this.slimLoadingBarService.complete();
|
|
15969
15970
|
resolve(false);
|
|
15970
15971
|
return;
|
|
15971
15972
|
}
|
|
15973
|
+
console.log('canActivate 5');
|
|
15972
15974
|
/** @type {?} */
|
|
15973
15975
|
var p = new QParam();
|
|
15974
|
-
p.sql = "
|
|
15975
|
-
|
|
15976
|
-
p.types = [
|
|
15977
|
-
p.values = [_this.appService.user];
|
|
15976
|
+
p.sql = "SELECT_USER_ACCESS_AUTH";
|
|
15977
|
+
p.values = [];
|
|
15978
|
+
p.types = [];
|
|
15978
15979
|
_this.querys.doQuery(p).subscribe(function (data) {
|
|
15979
|
-
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15980
|
+
if (data != null)
|
|
15981
|
+
if (data.result_msg == "OK")
|
|
15982
|
+
if (data.result_data.length > 0) {
|
|
15983
|
+
console.log('canActivate 6');
|
|
15984
|
+
_this.appService.user_roles = data.result_data[0].roles;
|
|
15985
|
+
if (_this.appService.user_roles.length > 0)
|
|
15986
|
+
_this.appService.user_roles = _this.appService.user_roles.substr(1);
|
|
15987
|
+
_this.appService.user_isadmin = data.result_data[0].isadmin;
|
|
15988
|
+
_this.appService.user = data.result_data[0].user;
|
|
15989
|
+
if (_this.app_s.user_isadmin != null)
|
|
15990
|
+
if (_this.app_s.user_isadmin == "1")
|
|
15991
|
+
return true;
|
|
15992
|
+
console.log('canActivate 7');
|
|
15993
|
+
/** @type {?} */
|
|
15994
|
+
var p_1 = new QParam();
|
|
15995
|
+
p_1.sql = "SELECT_APPS_USER_ALL";
|
|
15996
|
+
_this.appService.getState().app_enabled = new Array();
|
|
15997
|
+
p_1.types = ['string'];
|
|
15998
|
+
p_1.values = [_this.appService.user];
|
|
15999
|
+
console.log('canActivate 8');
|
|
16000
|
+
_this.querys.doQuery(p_1).subscribe(function (data) {
|
|
16001
|
+
console.log('canActivate 9');
|
|
16002
|
+
_this.arr_accessi = data.result_data;
|
|
16003
|
+
for (var i = 0; i < _this.arr_accessi.length; i++) {
|
|
16004
|
+
console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
|
|
16005
|
+
if (_this.arr_accessi[i].type == 'M') {
|
|
16006
|
+
if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
|
|
16007
|
+
resolve(true);
|
|
16008
|
+
return;
|
|
16009
|
+
}
|
|
16010
|
+
}
|
|
16011
|
+
}
|
|
16012
|
+
console.log('canActivate 11');
|
|
16013
|
+
_this.toast.error("ACCESS DENIED [0X0001]");
|
|
16014
|
+
resolve(false);
|
|
16015
|
+
_this.slimLoadingBarService.complete();
|
|
16016
|
+
return;
|
|
16017
|
+
});
|
|
16018
|
+
}
|
|
16019
|
+
else {
|
|
16020
|
+
_this.toast.error("ACCESS DENIED [0X0002]");
|
|
16021
|
+
_this.slimLoadingBarService.complete();
|
|
16022
|
+
return false;
|
|
15986
16023
|
}
|
|
15987
|
-
}
|
|
15988
|
-
}
|
|
15989
|
-
_this.toast.error("ACCESS DENIED");
|
|
15990
|
-
resolve(false);
|
|
15991
|
-
_this.slimLoadingBarService.complete();
|
|
15992
|
-
return;
|
|
15993
16024
|
});
|
|
15994
16025
|
});
|
|
16026
|
+
console.log('canActivate 12');
|
|
15995
16027
|
}
|
|
15996
16028
|
else {
|
|
15997
|
-
this.toast.error("ACCESS DENIED");
|
|
16029
|
+
this.toast.error("ACCESS DENIED [0X0004]");
|
|
15998
16030
|
this.slimLoadingBarService.complete();
|
|
15999
16031
|
return false;
|
|
16000
16032
|
}
|