@fluxhub/fluxhub-lib 1.0.196 → 1.0.198

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.
@@ -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, inject, NgModule, HostListener } from '@angular/core';
36
+ import { Injectable, Component, Input, Output, EventEmitter, Directive, forwardRef, Inject, PLATFORM_ID, ViewChild, ElementRef, Pipe, ViewContainerRef, defineInjectable, inject, NgModule, 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,112 @@ var FHGuard = /** @class */ (function () {
15950
15949
  if (this.auth.checkCredentials()) {
15951
15950
  if (this.routingDestination == 'home')
15952
15951
  return true;
15953
- if (localStorage.getItem(this.app_s.COMPANY_KEY + "user_isadmin") != null)
15954
- if (localStorage.getItem(this.app_s.COMPANY_KEY + "user_isadmin") == "1")
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
- _this.toast.error("ACCESS DENIED");
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 = "SELECT_APPS_USER_ALL";
15975
- _this.appService.getState().app_enabled = new Array();
15976
- p.types = ['string'];
15977
- p.values = [_this.appService.user];
15978
- _this.querys.doQuery(p).subscribe(function (data) {
15979
- _this.arr_accessi = data.result_data;
15980
- for (var i_1 = 0; i_1 < _this.arr_accessi.length; i_1++) {
15981
- console.log('[' + _this.arr_accessi[i_1].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
15982
- if (_this.arr_accessi[i_1].type == 'M') {
15983
- if ('[' + _this.arr_accessi[i_1].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
15984
- resolve(true);
15985
- return;
15976
+ p.sql = "SELECT_USER_ACCESS_AUTH";
15977
+ p.values = [];
15978
+ p.types = [];
15979
+ if (_this.appService.user == null) {
15980
+ _this.querys.doQuery(p).subscribe(function (data) {
15981
+ if (data != null)
15982
+ if (data.result_msg == "OK")
15983
+ if (data.result_data.length > 0) {
15984
+ console.log('canActivate 6');
15985
+ _this.appService.user_roles = data.result_data[0].roles;
15986
+ if (_this.appService.user_roles.length > 0)
15987
+ _this.appService.user_roles = _this.appService.user_roles.substr(1);
15988
+ _this.appService.user_isadmin = data.result_data[0].isadmin;
15989
+ _this.appService.user = data.result_data[0].username;
15990
+ if (_this.app_s.user_isadmin != null)
15991
+ if (_this.app_s.user_isadmin == "1")
15992
+ return true;
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;
16023
+ }
16024
+ });
16025
+ }
16026
+ else {
16027
+ /** @type {?} */
16028
+ var p_2 = new QParam();
16029
+ p_2.sql = "SELECT_APPS_USER_ALL";
16030
+ _this.appService.getState().app_enabled = new Array();
16031
+ p_2.types = ['string'];
16032
+ p_2.values = [_this.appService.user];
16033
+ console.log('canActivate 8');
16034
+ _this.querys.doQuery(p_2).subscribe(function (data) {
16035
+ console.log('canActivate 9');
16036
+ _this.arr_accessi = data.result_data;
16037
+ for (var i = 0; i < _this.arr_accessi.length; i++) {
16038
+ console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
16039
+ if (_this.arr_accessi[i].type == 'M') {
16040
+ if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
16041
+ resolve(true);
16042
+ return;
16043
+ }
15986
16044
  }
15987
16045
  }
15988
- }
15989
- _this.toast.error("ACCESS DENIED");
15990
- resolve(false);
15991
- _this.slimLoadingBarService.complete();
15992
- return;
15993
- });
16046
+ console.log('canActivate 11');
16047
+ _this.toast.error("ACCESS DENIED [0X0001]");
16048
+ resolve(false);
16049
+ _this.slimLoadingBarService.complete();
16050
+ return;
16051
+ });
16052
+ }
15994
16053
  });
16054
+ console.log('canActivate 12');
15995
16055
  }
15996
16056
  else {
15997
- this.toast.error("ACCESS DENIED");
16057
+ this.toast.error("ACCESS DENIED [0X0004]");
15998
16058
  this.slimLoadingBarService.complete();
15999
16059
  return false;
16000
16060
  }