@coolon/angular-ui-powerups 14.43.0 → 14.45.0
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/interaction/components/input-activities/input-activity.mjs +8 -2
- package/esm2020/lib/interaction/components/input-activities/select-input-activity.mjs +1 -1
- package/esm2020/lib/place/components/place-outlet/place-outlet.component.mjs +2 -2
- package/esm2020/lib/place/exports.mjs +2 -1
- package/esm2020/lib/place/guards/place.guard.mjs +10 -9
- package/esm2020/lib/place/place-access-guard.mjs +1 -1
- package/esm2020/lib/place/place-auth-service.mjs +121 -0
- package/esm2020/lib/place/place-component.mjs +3 -3
- package/esm2020/lib/place/place-router.mjs +6 -28
- package/fesm2015/coolon-angular-ui-powerups.mjs +159 -55
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +158 -55
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/components/input-activities/input-activity.d.ts +2 -0
- package/lib/place/exports.d.ts +1 -0
- package/lib/place/guards/place.guard.d.ts +2 -2
- package/lib/place/place-access-guard.d.ts +2 -2
- package/lib/place/place-auth-service.d.ts +49 -0
- package/lib/place/place-router.d.ts +2 -9
- package/package.json +3 -2
|
@@ -39,7 +39,7 @@ import { MatTableModule } from '@angular/material/table';
|
|
|
39
39
|
import * as i4$1 from '@angular/material/tooltip';
|
|
40
40
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
41
41
|
import * as i1$3 from '@coolon/pectin';
|
|
42
|
-
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, DelegatingCommand, PageController, PagedListModel, ComputedListModel, Deferred } from '@coolon/pectin';
|
|
42
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, DelegatingCommand, PageController, PagedListModel, ComputedListModel, ReducingValueModel, AndValueModel, Deferred } from '@coolon/pectin';
|
|
43
43
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
44
44
|
import * as i1 from '@angular/platform-browser';
|
|
45
45
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
@@ -60,8 +60,9 @@ import * as i1$6 from '@angular/material/dialog';
|
|
|
60
60
|
import { MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
61
61
|
import * as i1$4 from '@angular/router';
|
|
62
62
|
import { ActivatedRouteSnapshot, UrlSegment, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterModule } from '@angular/router';
|
|
63
|
-
import {
|
|
63
|
+
import { ArrayMultimap } from '@teppeis/multimaps';
|
|
64
64
|
import 'reflect-metadata';
|
|
65
|
+
import { Memoize as Memoize$1 } from 'typescript-memoize';
|
|
65
66
|
import * as i1$5 from '@angular/cdk/overlay';
|
|
66
67
|
import * as i3$2 from '@angular/material/list';
|
|
67
68
|
import { MatListModule } from '@angular/material/list';
|
|
@@ -6413,11 +6414,11 @@ class PlaceComponent extends DisposableComponent {
|
|
|
6413
6414
|
this.authorisedChildPlaces$ = chain(this.childPlaces$)
|
|
6414
6415
|
.select(placeType => {
|
|
6415
6416
|
const definition = PlaceComponent.getDefinition(placeType);
|
|
6416
|
-
const guard = this.placeRouter.accessGuard$.value;
|
|
6417
|
+
const guard = this.placeRouter.authService.accessGuard$.value;
|
|
6417
6418
|
return guard.isAuthorised(definition) || this.placeRouter.activeVisit$.value?.isPlaceActive(definition);
|
|
6418
6419
|
}, {
|
|
6419
6420
|
postponeWhile: this.placeRouter.navigationInProgress$,
|
|
6420
|
-
dependsOn: [this.placeRouter.accessGuard$, this.placeRouter.activeVisit$]
|
|
6421
|
+
dependsOn: [this.placeRouter.authService.accessGuard$, this.placeRouter.activeVisit$]
|
|
6421
6422
|
});
|
|
6422
6423
|
}
|
|
6423
6424
|
initialiseVisit(visit, notifyVisitChanged) {
|
|
@@ -6762,6 +6763,123 @@ __decorate([
|
|
|
6762
6763
|
// .withAncestorParameters(ParentB, {id: "c"}) // barf if not a ancestor or missing parameters are required or parameter isn't valid
|
|
6763
6764
|
//
|
|
6764
6765
|
|
|
6766
|
+
class PlaceAuthorisationChecker extends ReducingValueModel {
|
|
6767
|
+
constructor() {
|
|
6768
|
+
super([]);
|
|
6769
|
+
this.predicatesByPlace = new ArrayMultimap;
|
|
6770
|
+
this.defaultAuthCheck = () => true;
|
|
6771
|
+
}
|
|
6772
|
+
setDefaultAuthCheck(options) {
|
|
6773
|
+
this.defaultAuthCheck = (placeDef) => {
|
|
6774
|
+
return options.isAuthorised(placeDef);
|
|
6775
|
+
};
|
|
6776
|
+
if (options.dependsOn) {
|
|
6777
|
+
this.trackSource(options.dependsOn);
|
|
6778
|
+
}
|
|
6779
|
+
}
|
|
6780
|
+
authoriseWhen(placeDefinition, condition$) {
|
|
6781
|
+
const { chain } = Dsl.disposeWith(this);
|
|
6782
|
+
this.predicatesByPlace.put(placeDefinition, condition$);
|
|
6783
|
+
this.trackSource(condition$);
|
|
6784
|
+
}
|
|
6785
|
+
isAuthorised(placeDef) {
|
|
6786
|
+
return this.value(placeDef);
|
|
6787
|
+
}
|
|
6788
|
+
compute(values) {
|
|
6789
|
+
return (def) => {
|
|
6790
|
+
return this.defaultAuthCheck(def) && this.checkPredicatesByPlace(def);
|
|
6791
|
+
};
|
|
6792
|
+
}
|
|
6793
|
+
checkPredicatesByPlace(def) {
|
|
6794
|
+
const placePredicates = this.predicatesByPlace.get(def);
|
|
6795
|
+
if (!placePredicates || placePredicates.length < 1) {
|
|
6796
|
+
return true;
|
|
6797
|
+
}
|
|
6798
|
+
else {
|
|
6799
|
+
return placePredicates.reduce((sum, model) => {
|
|
6800
|
+
return sum && model.value;
|
|
6801
|
+
}, true);
|
|
6802
|
+
}
|
|
6803
|
+
}
|
|
6804
|
+
}
|
|
6805
|
+
class PlaceAuthService extends GarbageCollector {
|
|
6806
|
+
constructor() {
|
|
6807
|
+
super();
|
|
6808
|
+
this.placeGuards$ = new MutableListModel();
|
|
6809
|
+
this._ready$ = new AndValueModel().setDefault(true);
|
|
6810
|
+
this.authenticated$ = this.registerDisposable(new DelegatingValueModel).withDefault(true);
|
|
6811
|
+
this.authorisationChecker$ = this.registerDisposable(new PlaceAuthorisationChecker());
|
|
6812
|
+
const { chain } = Dsl.disposeWith(this);
|
|
6813
|
+
this.accessGuard$ = chain.reduce(this.authenticated$, this.authorisationChecker$, (authenticated, authCheck) => {
|
|
6814
|
+
return new PlaceAuthService.AccessGuard(authenticated, authCheck);
|
|
6815
|
+
});
|
|
6816
|
+
}
|
|
6817
|
+
configureAuthentication(options) {
|
|
6818
|
+
this.authNOptions = options;
|
|
6819
|
+
this.authenticated$.setDelegate(options.isAuthenticated$);
|
|
6820
|
+
this.capturePostoneDependency(options);
|
|
6821
|
+
}
|
|
6822
|
+
configureAuthorisation(options) {
|
|
6823
|
+
const { chain } = Dsl.disposeWith(this);
|
|
6824
|
+
this.authZOptions = options;
|
|
6825
|
+
this.authorisationChecker$.setDefaultAuthCheck(options);
|
|
6826
|
+
this.capturePostoneDependency(options);
|
|
6827
|
+
}
|
|
6828
|
+
enablePlace(placeDefinition, options) {
|
|
6829
|
+
const { chain } = Dsl.disposeWith(this);
|
|
6830
|
+
const when$ = options.when$ ? options.when$ : chain(options.unless$).isFalsey();
|
|
6831
|
+
this.authorisationChecker$.authoriseWhen(PlaceComponent.getDefinition(placeDefinition), when$);
|
|
6832
|
+
this.capturePostoneDependency(options);
|
|
6833
|
+
}
|
|
6834
|
+
waitUntilReady() {
|
|
6835
|
+
return this.toPromise(this._ready$);
|
|
6836
|
+
}
|
|
6837
|
+
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
6838
|
+
const redirect = this.authNOptions.redirectTo(activatedRoute, state);
|
|
6839
|
+
return redirect instanceof Visit ? redirect : Visit.goto(redirect);
|
|
6840
|
+
}
|
|
6841
|
+
getAuthorisationFailureRedirectOptions(component) {
|
|
6842
|
+
return this.authZOptions.redirectTo(component).map(it => it instanceof Visit ? it : Visit.goto(it));
|
|
6843
|
+
}
|
|
6844
|
+
toPromise(condition$) {
|
|
6845
|
+
// TODO: move this functionality to pectin with a waitUnit(model$).isTruthy() DSL.
|
|
6846
|
+
const { when } = Dsl.disposeWith(this);
|
|
6847
|
+
return new Promise((resolve) => {
|
|
6848
|
+
when(condition$).becomesTruthy(() => resolve(), { once: true, initialValue: "evaluate" });
|
|
6849
|
+
});
|
|
6850
|
+
}
|
|
6851
|
+
capturePostoneDependency(options) {
|
|
6852
|
+
const { chain } = Dsl.disposeWith(this);
|
|
6853
|
+
if (options.postponeUntil) {
|
|
6854
|
+
this._ready$.addSource(options.postponeUntil);
|
|
6855
|
+
}
|
|
6856
|
+
else if (options.postponeWhile) {
|
|
6857
|
+
this._ready$.addSource(chain(options.postponeWhile).isFalsey());
|
|
6858
|
+
}
|
|
6859
|
+
}
|
|
6860
|
+
isAuthenticated() {
|
|
6861
|
+
return this.accessGuard$.value.isAuthenticated();
|
|
6862
|
+
}
|
|
6863
|
+
isAuthorised(c) {
|
|
6864
|
+
return this.accessGuard$.value.isAuthorised(c);
|
|
6865
|
+
}
|
|
6866
|
+
}
|
|
6867
|
+
(function (PlaceAuthService) {
|
|
6868
|
+
class AccessGuard {
|
|
6869
|
+
constructor(authenticated, authCheck) {
|
|
6870
|
+
this.authenticated = authenticated;
|
|
6871
|
+
this.authCheck = authCheck;
|
|
6872
|
+
}
|
|
6873
|
+
isAuthenticated() {
|
|
6874
|
+
return this.authenticated;
|
|
6875
|
+
}
|
|
6876
|
+
isAuthorised(placeDefinition) {
|
|
6877
|
+
return this.authCheck(placeDefinition);
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
PlaceAuthService.AccessGuard = AccessGuard;
|
|
6881
|
+
})(PlaceAuthService || (PlaceAuthService = {}));
|
|
6882
|
+
|
|
6765
6883
|
/**
|
|
6766
6884
|
* This class handles the logic around canDeactivate for a given router state transition. It's core responsibilities are:
|
|
6767
6885
|
* 1. Ensure we only ask the component to deactivate once on a given navigation cycle (since visit sanitisation can result in multiple round trips to through the router.)
|
|
@@ -7535,21 +7653,6 @@ class PopStateNavigation extends AbstractPopStateNavigation {
|
|
|
7535
7653
|
}
|
|
7536
7654
|
}
|
|
7537
7655
|
|
|
7538
|
-
var PlaceAccessGuard;
|
|
7539
|
-
(function (PlaceAccessGuard) {
|
|
7540
|
-
class NoAuth {
|
|
7541
|
-
// @Trace()
|
|
7542
|
-
isAuthenticated() {
|
|
7543
|
-
return true;
|
|
7544
|
-
}
|
|
7545
|
-
// @Trace()
|
|
7546
|
-
isAuthorised(placeDefinition) {
|
|
7547
|
-
return true;
|
|
7548
|
-
}
|
|
7549
|
-
}
|
|
7550
|
-
PlaceAccessGuard.NoAuth = NoAuth;
|
|
7551
|
-
})(PlaceAccessGuard || (PlaceAccessGuard = {}));
|
|
7552
|
-
|
|
7553
7656
|
/**
|
|
7554
7657
|
* TODO: this should be updated to store the last x visists rathern than a map of places to visit segments.
|
|
7555
7658
|
* This would allow it to return segments that are relevent to a particular parent path. Currently
|
|
@@ -7932,11 +8035,7 @@ class PlaceRouter extends GarbageCollector {
|
|
|
7932
8035
|
this.navigationSession$ = new MutableValueModel();
|
|
7933
8036
|
this._activeVisit$ = new MutableValueModel();
|
|
7934
8037
|
this.sessionFinishedJobs = [];
|
|
7935
|
-
|
|
7936
|
-
* An observable model containing the authoriser function. This allows places to react to changes
|
|
7937
|
-
* in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
|
|
7938
|
-
*/
|
|
7939
|
-
this._accessGuard$ = this.registerDisposable(new DelegatingValueModel().withDefault(new PlaceAccessGuard.NoAuth()));
|
|
8038
|
+
this.authService = new PlaceAuthService();
|
|
7940
8039
|
if (window["Cypress"]) {
|
|
7941
8040
|
window["aup.PlaceRouter"] = this;
|
|
7942
8041
|
}
|
|
@@ -7995,29 +8094,11 @@ class PlaceRouter extends GarbageCollector {
|
|
|
7995
8094
|
// the back button was clicked.
|
|
7996
8095
|
angularLocation.onUrlChange(url => this.onUrlChanged(url));
|
|
7997
8096
|
}
|
|
7998
|
-
get accessGuard$() {
|
|
7999
|
-
return this._accessGuard$.readonly;
|
|
8000
|
-
}
|
|
8001
|
-
// @Trace()
|
|
8002
|
-
configureAuth(accessGrant, redirections) {
|
|
8003
|
-
// We need a shitty mutable model until setDelegate is clever enough to work with readonly models.
|
|
8004
|
-
const hackyMutableModel = new MutableValueModel();
|
|
8005
|
-
const binding = new Binding(hackyMutableModel, accessGrant, {
|
|
8006
|
-
toRight(leftValue) {
|
|
8007
|
-
return lang.illegalState("hackyMutableModel is read only");
|
|
8008
|
-
},
|
|
8009
|
-
toLeft: (rightValue) => rightValue
|
|
8010
|
-
});
|
|
8011
|
-
binding.writeLeft();
|
|
8012
|
-
this._accessGuard$.setDelegate(hackyMutableModel);
|
|
8013
|
-
this.redirections = redirections;
|
|
8014
|
-
}
|
|
8015
8097
|
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
8016
|
-
|
|
8017
|
-
return redirect instanceof Visit ? redirect : Visit.goto(redirect);
|
|
8098
|
+
return this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
8018
8099
|
}
|
|
8019
8100
|
getAuthorisationFailureRedirectOptions(component) {
|
|
8020
|
-
return this.
|
|
8101
|
+
return this.authService.getAuthorisationFailureRedirectOptions(component);
|
|
8021
8102
|
}
|
|
8022
8103
|
get navigationSession() {
|
|
8023
8104
|
return this.navigationSession$.value;
|
|
@@ -9379,6 +9460,9 @@ class InputActivity extends Activity {
|
|
|
9379
9460
|
get additionalCssClassName() {
|
|
9380
9461
|
return this.activityData.cssClassName ?? '';
|
|
9381
9462
|
}
|
|
9463
|
+
get dataCyAttribute() {
|
|
9464
|
+
return this.activityData.dataCy ?? '';
|
|
9465
|
+
}
|
|
9382
9466
|
onEscape() {
|
|
9383
9467
|
if (this.shouldCancelOnEscape() && this.cancelCommand.enabled$.value) {
|
|
9384
9468
|
this.cancelCommand.execute();
|
|
@@ -9390,7 +9474,7 @@ class InputActivity extends Activity {
|
|
|
9390
9474
|
}
|
|
9391
9475
|
}
|
|
9392
9476
|
InputActivity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InputActivity, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9393
|
-
InputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: InputActivity, selector: "ng-component", inputs: { layout: "layout" }, host: { listeners: { "keydown.escape": "onEscape()" }, properties: { "class": "this.additionalCssClassName", "attr.layout": "this.layout" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
9477
|
+
InputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: InputActivity, selector: "ng-component", inputs: { layout: "layout" }, host: { listeners: { "keydown.escape": "onEscape()" }, properties: { "class": "this.additionalCssClassName", "attr.layout": "this.layout", "attr.data-cy": "this.dataCyAttribute" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
9394
9478
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InputActivity, decorators: [{
|
|
9395
9479
|
type: Component,
|
|
9396
9480
|
args: [{ template: `` }]
|
|
@@ -9405,6 +9489,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9405
9489
|
}], additionalCssClassName: [{
|
|
9406
9490
|
type: HostBinding,
|
|
9407
9491
|
args: ["class"]
|
|
9492
|
+
}], dataCyAttribute: [{
|
|
9493
|
+
type: HostBinding,
|
|
9494
|
+
args: ["attr.data-cy"]
|
|
9408
9495
|
}], onEscape: [{
|
|
9409
9496
|
type: HostListener,
|
|
9410
9497
|
args: ['keydown.escape']
|
|
@@ -10006,7 +10093,7 @@ class PlaceOutletComponent extends DisposableComponent {
|
|
|
10006
10093
|
chain(this._activePlaceModel)
|
|
10007
10094
|
.postponeWhile(this.navigationInProgress)
|
|
10008
10095
|
.subscribe(place => this.placeChanged.emit(place));
|
|
10009
|
-
this.authorised = chain(placeRouter.accessGuard$).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {
|
|
10096
|
+
this.authorised = chain(placeRouter.authService.accessGuard$).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {
|
|
10010
10097
|
dependsOn: this._activePlaceDefinition,
|
|
10011
10098
|
postponeWhile: chain(this._activePlaceDefinition).isNil()
|
|
10012
10099
|
}).otherwise(true); // if we don't have a place def yet we need to show the outlet so we get one injected.
|
|
@@ -10680,6 +10767,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
10680
10767
|
* @file Automatically generated by barrelsby.
|
|
10681
10768
|
*/
|
|
10682
10769
|
|
|
10770
|
+
var PlaceAccessGuard;
|
|
10771
|
+
(function (PlaceAccessGuard) {
|
|
10772
|
+
class NoAuth {
|
|
10773
|
+
// @Trace()
|
|
10774
|
+
isAuthenticated() {
|
|
10775
|
+
return true;
|
|
10776
|
+
}
|
|
10777
|
+
// @Trace()
|
|
10778
|
+
isAuthorised(placeDefinition) {
|
|
10779
|
+
return true;
|
|
10780
|
+
}
|
|
10781
|
+
}
|
|
10782
|
+
PlaceAccessGuard.NoAuth = NoAuth;
|
|
10783
|
+
})(PlaceAccessGuard || (PlaceAccessGuard = {}));
|
|
10784
|
+
|
|
10683
10785
|
function Place(options) {
|
|
10684
10786
|
return (target) => {
|
|
10685
10787
|
if (PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
@@ -10760,24 +10862,25 @@ class PlaceGuard {
|
|
|
10760
10862
|
this.interactionService = interactionService;
|
|
10761
10863
|
this.injector = injector;
|
|
10762
10864
|
}
|
|
10763
|
-
get
|
|
10764
|
-
return this.placeRouter.
|
|
10865
|
+
get authService() {
|
|
10866
|
+
return this.placeRouter.authService;
|
|
10765
10867
|
}
|
|
10766
10868
|
// @Trace()
|
|
10767
10869
|
async canActivate(activatedRoute, state) {
|
|
10768
10870
|
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
10769
10871
|
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
10770
10872
|
if (placeDefinition.authenticate) {
|
|
10771
|
-
|
|
10873
|
+
await this.placeRouter.authService.waitUntilReady();
|
|
10874
|
+
const authenticated = this.authService.isAuthenticated();
|
|
10772
10875
|
if (!authenticated) {
|
|
10773
|
-
const redirect = this.
|
|
10876
|
+
const redirect = this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
10774
10877
|
// const nextPlaceDef = this.getPlaceDefinition(redirect);
|
|
10775
10878
|
if (redirect.requiresAuthentication()) {
|
|
10776
10879
|
lang.illegalState(`onAuthenticationFailure hook returned place ${redirect.toDebugString()} that requires authentication.`);
|
|
10777
10880
|
}
|
|
10778
10881
|
return this.createUrlTree(redirect);
|
|
10779
10882
|
}
|
|
10780
|
-
if (!this.
|
|
10883
|
+
if (!this.authService.isAuthorised(placeDefinition)) {
|
|
10781
10884
|
const nextRedirect = this.findBestAuthenticatedAlternative(placeDefinition, activatedRoute);
|
|
10782
10885
|
return this.createUrlTree(nextRedirect);
|
|
10783
10886
|
}
|
|
@@ -10806,7 +10909,7 @@ class PlaceGuard {
|
|
|
10806
10909
|
lang.illegalState(`redirectToFirstChild set to true, but there were no children `);
|
|
10807
10910
|
}
|
|
10808
10911
|
for (let child of placeDefinition.children) {
|
|
10809
|
-
if (!child.authenticate || this.
|
|
10912
|
+
if (!child.authenticate || this.authService.isAuthorised(child)) {
|
|
10810
10913
|
return destUrlSnapshot.appendSegment(new VisitSegment(child));
|
|
10811
10914
|
}
|
|
10812
10915
|
}
|
|
@@ -10826,7 +10929,7 @@ class PlaceGuard {
|
|
|
10826
10929
|
let currentPlace = placeDefinition;
|
|
10827
10930
|
while (!currentPlace.isRoot()) {
|
|
10828
10931
|
currentPlace = currentPlace.parent;
|
|
10829
|
-
const permittedChild = currentPlace.findChild(c => this.
|
|
10932
|
+
const permittedChild = currentPlace.findChild(c => this.authService.isAuthorised(c));
|
|
10830
10933
|
if (permittedChild) {
|
|
10831
10934
|
return Visit.goto(permittedChild.component);
|
|
10832
10935
|
}
|
|
@@ -10837,7 +10940,7 @@ class PlaceGuard {
|
|
|
10837
10940
|
return lang.illegalState(`onAuthorisationFailure hook didn't return any alternate places`);
|
|
10838
10941
|
}
|
|
10839
10942
|
else {
|
|
10840
|
-
const nextRedirect = alternativeRoutes.find(it => it.isAuthorised(this.
|
|
10943
|
+
const nextRedirect = alternativeRoutes.find(it => it.isAuthorised(this.authService));
|
|
10841
10944
|
return nextRedirect ?? lang.illegalState(`onAuthorisationFailure hook didn't return any authorised locations`);
|
|
10842
10945
|
}
|
|
10843
10946
|
}
|
|
@@ -11068,5 +11171,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
11068
11171
|
* Generated bundle index. Do not edit.
|
|
11069
11172
|
*/
|
|
11070
11173
|
|
|
11071
|
-
export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, ColumnTextSearchFormatter, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, GarbageCollectorDirective, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, Keys, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectInputActivity, SelectInputComponent, SelectionCellComponent, SelectionColumnModel, SelectionHeaderCellComponent, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableBodyComponent, TableCellComponent, TableComponent, TableFilterModel, TableHeaderCellComponent, TableModel, TableMoreMenuComponent, TableMoreMenuPopupComponent, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSegment, VisitSegmentSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownAndRightOnEnterAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
|
|
11174
|
+
export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, ColumnTextSearchFormatter, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, GarbageCollectorDirective, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, Keys, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceAuthService, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectInputActivity, SelectInputComponent, SelectionCellComponent, SelectionColumnModel, SelectionHeaderCellComponent, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableBodyComponent, TableCellComponent, TableComponent, TableFilterModel, TableHeaderCellComponent, TableModel, TableMoreMenuComponent, TableMoreMenuPopupComponent, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSegment, VisitSegmentSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownAndRightOnEnterAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
|
|
11072
11175
|
//# sourceMappingURL=coolon-angular-ui-powerups.mjs.map
|