@resolveio/client-lib-core 1.3.15 → 1.3.16
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/esm2020/lib/auth/auth-guard.service.mjs +43 -108
- package/esm2020/lib/models/permission.model.mjs +1 -1
- package/esm2020/lib/widgets/navbar-module/navbar-module.component.mjs +6 -10
- package/fesm2015/resolveio-client-lib-core.mjs +47 -116
- package/fesm2015/resolveio-client-lib-core.mjs.map +1 -1
- package/fesm2020/resolveio-client-lib-core.mjs +47 -116
- package/fesm2020/resolveio-client-lib-core.mjs.map +1 -1
- package/lib/auth/auth-guard.service.d.ts +0 -1
- package/lib/models/permission.model.d.ts +0 -1
- package/package.json +1 -1
|
@@ -4840,15 +4840,7 @@ class NavbarModuleComponent extends BaseComponent {
|
|
|
4840
4840
|
else {
|
|
4841
4841
|
this.currentRoute = this._services._router.url.replace(/\/[a-f0-9]{24}$/, '').replace(/\?.+$/, '');
|
|
4842
4842
|
this.selectedTab = null;
|
|
4843
|
-
|
|
4844
|
-
let tab = this.menuData.tabs[i];
|
|
4845
|
-
if (tab.link === this.currentRoute) {
|
|
4846
|
-
this.selectedTab = tab;
|
|
4847
|
-
break;
|
|
4848
|
-
}
|
|
4849
|
-
}
|
|
4850
|
-
while (!this.selectedTab && this.currentRoute.includes('/')) {
|
|
4851
|
-
this.currentRoute = this.currentRoute.replace(/(\/[^\/]+$)/, '');
|
|
4843
|
+
while (!this.selectedTab && this.currentRoute.split('/').length > 1) {
|
|
4852
4844
|
for (let i = 0; i < this.menuData.tabs.length; i++) {
|
|
4853
4845
|
let tab = this.menuData.tabs[i];
|
|
4854
4846
|
if (tab.link === this.currentRoute) {
|
|
@@ -4856,6 +4848,10 @@ class NavbarModuleComponent extends BaseComponent {
|
|
|
4856
4848
|
break;
|
|
4857
4849
|
}
|
|
4858
4850
|
}
|
|
4851
|
+
this.currentRoute = this.currentRoute.replace(/(\/[^\/]+$)/, '');
|
|
4852
|
+
}
|
|
4853
|
+
if (!this.selectedTab) {
|
|
4854
|
+
this.selectedTab = this.menuData.tabs[0];
|
|
4859
4855
|
}
|
|
4860
4856
|
}
|
|
4861
4857
|
}
|
|
@@ -5523,61 +5519,35 @@ class AuthGuard {
|
|
|
5523
5519
|
resolve(false);
|
|
5524
5520
|
}
|
|
5525
5521
|
else {
|
|
5526
|
-
let
|
|
5527
|
-
let
|
|
5528
|
-
let moduleView = partialView.replace(/^(\/[-a-z]+\/).*$/, '$1'); //Module Only
|
|
5522
|
+
let pageView = state.url.replace(/\/[a-f0-9]{24}$/, '').replace(/\?.+$/, ''); //All but ID and Query String
|
|
5523
|
+
let moduleView = pageView.replace(/([^\/]+\/?$)/, '');
|
|
5529
5524
|
if (user.roles.super_admin) {
|
|
5530
5525
|
resolve(true);
|
|
5531
5526
|
}
|
|
5532
|
-
else if (!this.isLinkFakeRoute(fullView)) {
|
|
5533
|
-
if (!this.isLinkPartialRoute(fullView) && !user.roles.groups.some(a => a.views.some(b => b === fullView))) {
|
|
5534
|
-
if (user.roles.groups.some(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))) {
|
|
5535
|
-
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5536
|
-
this._router.navigateByUrl(link);
|
|
5537
|
-
}
|
|
5538
|
-
else {
|
|
5539
|
-
this._router.navigateByUrl('/home');
|
|
5540
|
-
}
|
|
5541
|
-
resolve(false);
|
|
5542
|
-
}
|
|
5543
|
-
else if (this.isLinkPartialRoute(fullView) && !user.roles.groups.some(a => a.views.some(b => b.startsWith(fullView) || fullView.startsWith(b)))) {
|
|
5544
|
-
if (user.roles.groups.some(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))) {
|
|
5545
|
-
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5546
|
-
this._router.navigateByUrl(link);
|
|
5547
|
-
}
|
|
5548
|
-
else {
|
|
5549
|
-
this._router.navigateByUrl('/home');
|
|
5550
|
-
}
|
|
5551
|
-
resolve(false);
|
|
5552
|
-
}
|
|
5553
|
-
else {
|
|
5554
|
-
resolve(true);
|
|
5555
|
-
}
|
|
5556
|
-
}
|
|
5557
5527
|
else {
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5528
|
+
let done = false;
|
|
5529
|
+
while (!done && pageView.split('/').length > 1) {
|
|
5530
|
+
if (!this.isLinkFakeRoute(pageView)) {
|
|
5531
|
+
if (!user.roles.groups.some(a => a.views.some(b => b === pageView))) {
|
|
5532
|
+
if (user.roles.groups.some(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))) {
|
|
5533
|
+
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5534
|
+
done = true;
|
|
5535
|
+
this._router.navigateByUrl(link);
|
|
5536
|
+
resolve(false);
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5539
|
+
else {
|
|
5540
|
+
done = true;
|
|
5541
|
+
resolve(true);
|
|
5542
|
+
}
|
|
5562
5543
|
}
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
}
|
|
5566
|
-
resolve(false);
|
|
5544
|
+
moduleView = moduleView.replace(/([^\/]+\/?$)/, '');
|
|
5545
|
+
pageView = pageView.replace(/(\/[^\/]+$)/, '');
|
|
5567
5546
|
}
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5571
|
-
this._router.navigateByUrl(link);
|
|
5572
|
-
}
|
|
5573
|
-
else {
|
|
5574
|
-
this._router.navigateByUrl('/home');
|
|
5575
|
-
}
|
|
5547
|
+
if (!done) {
|
|
5548
|
+
this._router.navigateByUrl('/home');
|
|
5576
5549
|
resolve(false);
|
|
5577
5550
|
}
|
|
5578
|
-
else {
|
|
5579
|
-
resolve(true);
|
|
5580
|
-
}
|
|
5581
5551
|
}
|
|
5582
5552
|
}
|
|
5583
5553
|
});
|
|
@@ -5596,61 +5566,35 @@ class AuthGuard {
|
|
|
5596
5566
|
resolve(false);
|
|
5597
5567
|
}
|
|
5598
5568
|
else {
|
|
5599
|
-
let
|
|
5600
|
-
let
|
|
5601
|
-
let moduleView = partialView.replace(/^(\/[-a-z]+\/).*$/, '$1'); //Module Only
|
|
5569
|
+
let pageView = state.url.replace(/\/[a-f0-9]{24}$/, '').replace(/\?.+$/, ''); //All but ID and Query String
|
|
5570
|
+
let moduleView = pageView.replace(/([^\/]+\/?$)/, '');
|
|
5602
5571
|
if (user.roles.super_admin) {
|
|
5603
5572
|
resolve(true);
|
|
5604
5573
|
}
|
|
5605
|
-
else if (!this.isLinkFakeRoute(fullView)) {
|
|
5606
|
-
if (!this.isLinkPartialRoute(fullView) && !user.roles.groups.some(a => a.views.some(b => b === fullView))) {
|
|
5607
|
-
if (user.roles.groups.some(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))) {
|
|
5608
|
-
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5609
|
-
this._router.navigateByUrl(link);
|
|
5610
|
-
}
|
|
5611
|
-
else {
|
|
5612
|
-
this._router.navigateByUrl('/home');
|
|
5613
|
-
}
|
|
5614
|
-
resolve(false);
|
|
5615
|
-
}
|
|
5616
|
-
else if (this.isLinkPartialRoute(fullView) && !user.roles.groups.some(a => a.views.some(b => b.startsWith(fullView) || fullView.startsWith(b)))) {
|
|
5617
|
-
if (user.roles.groups.some(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))) {
|
|
5618
|
-
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5619
|
-
this._router.navigateByUrl(link);
|
|
5620
|
-
}
|
|
5621
|
-
else {
|
|
5622
|
-
this._router.navigateByUrl('/home');
|
|
5623
|
-
}
|
|
5624
|
-
resolve(false);
|
|
5625
|
-
}
|
|
5626
|
-
else {
|
|
5627
|
-
resolve(true);
|
|
5628
|
-
}
|
|
5629
|
-
}
|
|
5630
5574
|
else {
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5575
|
+
let done = false;
|
|
5576
|
+
while (!done && pageView.split('/').length > 1) {
|
|
5577
|
+
if (!this.isLinkFakeRoute(pageView)) {
|
|
5578
|
+
if (!user.roles.groups.some(a => a.views.some(b => b === pageView))) {
|
|
5579
|
+
if (user.roles.groups.some(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))) {
|
|
5580
|
+
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5581
|
+
done = true;
|
|
5582
|
+
this._router.navigateByUrl(link);
|
|
5583
|
+
resolve(false);
|
|
5584
|
+
}
|
|
5585
|
+
}
|
|
5586
|
+
else {
|
|
5587
|
+
done = true;
|
|
5588
|
+
resolve(true);
|
|
5589
|
+
}
|
|
5638
5590
|
}
|
|
5639
|
-
|
|
5591
|
+
moduleView = moduleView.replace(/([^\/]+\/?$)/, '');
|
|
5592
|
+
pageView = pageView.replace(/(\/[^\/]+$)/, '');
|
|
5640
5593
|
}
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
let link = user.roles.groups.filter(a => a.views.some(b => b.startsWith(moduleView) && !this.doesLinkHaveParameter(b) && !this.isLinkFakeRoute(b)))[0].views.filter(a => a.startsWith(moduleView) && !this.doesLinkHaveParameter(a) && !this.isLinkFakeRoute(a))[0];
|
|
5644
|
-
this._router.navigateByUrl(link);
|
|
5645
|
-
}
|
|
5646
|
-
else {
|
|
5647
|
-
this._router.navigateByUrl('/home');
|
|
5648
|
-
}
|
|
5594
|
+
if (!done) {
|
|
5595
|
+
this._router.navigateByUrl('/home');
|
|
5649
5596
|
resolve(false);
|
|
5650
5597
|
}
|
|
5651
|
-
else {
|
|
5652
|
-
resolve(true);
|
|
5653
|
-
}
|
|
5654
5598
|
}
|
|
5655
5599
|
}
|
|
5656
5600
|
}
|
|
@@ -5683,19 +5627,6 @@ class AuthGuard {
|
|
|
5683
5627
|
}
|
|
5684
5628
|
return true;
|
|
5685
5629
|
}
|
|
5686
|
-
isLinkPartialRoute(link) {
|
|
5687
|
-
let permissions = this._aps.getAllModulePermissions();
|
|
5688
|
-
for (let i = 0; i < permissions.length; i++) {
|
|
5689
|
-
let permission = permissions[i];
|
|
5690
|
-
for (let j = 0; j < permission.views.length; j++) {
|
|
5691
|
-
let view = permission.views[j];
|
|
5692
|
-
if (view.link === link) {
|
|
5693
|
-
return !!view.partial_route;
|
|
5694
|
-
}
|
|
5695
|
-
}
|
|
5696
|
-
}
|
|
5697
|
-
return false;
|
|
5698
|
-
}
|
|
5699
5630
|
}
|
|
5700
5631
|
AuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: AuthGuard, deps: [{ token: i1$2.Router }, { token: AuthService }, { token: DialogService }, { token: AccountManagerService }, { token: CoreService }, { token: OfflineManagerService }, { token: AuthPermissionService }, { token: AlertService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5701
5632
|
AuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: AuthGuard });
|