@abp/ng.core 10.0.0-rc.3 → 10.0.1
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/fesm2022/abp-ng.core.mjs +16 -4
- package/fesm2022/abp-ng.core.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
package/fesm2022/abp-ng.core.mjs
CHANGED
|
@@ -5080,10 +5080,16 @@ class PermissionGuard {
|
|
|
5080
5080
|
if (!requiredPolicy) {
|
|
5081
5081
|
return of(true);
|
|
5082
5082
|
}
|
|
5083
|
-
return this.permissionService.getGrantedPolicy$(requiredPolicy).pipe(
|
|
5084
|
-
if (
|
|
5083
|
+
return this.permissionService.getGrantedPolicy$(requiredPolicy).pipe(take(1), map(access => {
|
|
5084
|
+
if (access)
|
|
5085
|
+
return true;
|
|
5086
|
+
if (route.data?.['redirectUrl']) {
|
|
5087
|
+
return this.router.parseUrl(route.data['redirectUrl']);
|
|
5088
|
+
}
|
|
5089
|
+
if (this.authService.isAuthenticated) {
|
|
5085
5090
|
this.httpErrorReporter.reportError({ status: 403 });
|
|
5086
5091
|
}
|
|
5092
|
+
return false;
|
|
5087
5093
|
}));
|
|
5088
5094
|
}
|
|
5089
5095
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: PermissionGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -5114,10 +5120,16 @@ const permissionGuard = (route, state) => {
|
|
|
5114
5120
|
if (isPlatformServer(platformId)) {
|
|
5115
5121
|
return of(true);
|
|
5116
5122
|
}
|
|
5117
|
-
return permissionService.getGrantedPolicy$(requiredPolicy).pipe(
|
|
5118
|
-
if (
|
|
5123
|
+
return permissionService.getGrantedPolicy$(requiredPolicy).pipe(take(1), map(access => {
|
|
5124
|
+
if (access)
|
|
5125
|
+
return true;
|
|
5126
|
+
if (route.data?.['redirectUrl']) {
|
|
5127
|
+
return router.parseUrl(route.data['redirectUrl']);
|
|
5128
|
+
}
|
|
5129
|
+
if (authService.isAuthenticated) {
|
|
5119
5130
|
httpErrorReporter.reportError({ status: 403 });
|
|
5120
5131
|
}
|
|
5132
|
+
return false;
|
|
5121
5133
|
}));
|
|
5122
5134
|
};
|
|
5123
5135
|
|