@genesislcap/foundation-auth 14.136.0 → 14.137.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/README.md +6 -33
- package/dist/dts/config/config.d.ts.map +1 -1
- package/dist/dts/entity/loginAck.d.ts +20 -25
- package/dist/dts/entity/loginAck.d.ts.map +1 -1
- package/dist/dts/machine/machine.d.ts +2 -2
- package/dist/dts/machine/machine.d.ts.map +1 -1
- package/dist/dts/machine/types.d.ts +1 -1
- package/dist/dts/machine/types.d.ts.map +1 -1
- package/dist/dts/routes/base.d.ts +13 -7
- package/dist/dts/routes/base.d.ts.map +1 -1
- package/dist/dts/routes/config.d.ts +1 -1
- package/dist/dts/routes/config.d.ts.map +1 -1
- package/dist/dts/routes/protected/protected.d.ts +2 -0
- package/dist/dts/routes/protected/protected.d.ts.map +1 -1
- package/dist/dts/routes/protected/protected.template.d.ts.map +1 -1
- package/dist/dts/user/index.d.ts +5 -2
- package/dist/dts/user/index.d.ts.map +1 -1
- package/dist/esm/config/config.js +1 -1
- package/dist/esm/machine/machine.js +2 -2
- package/dist/esm/routes/base.js +1 -1
- package/dist/esm/routes/config.js +1 -1
- package/dist/esm/routes/protected/protected.js +11 -1
- package/dist/esm/routes/protected/protected.template.js +8 -0
- package/dist/esm/user/index.js +5 -2
- package/dist/foundation-auth.api.json +2704 -5197
- package/dist/foundation-auth.d.ts +42 -287
- package/docs/api/foundation-auth.authmachinecontext.md +1 -1
- package/docs/api/foundation-auth.defaultauthmachine._constructor_.md +1 -1
- package/docs/api/foundation-auth.details.md +6 -13
- package/docs/api/foundation-auth.getauthmachine.md +1 -1
- package/docs/api/foundation-auth.loginack.md +2 -16
- package/docs/api/foundation-auth.md +0 -9
- package/docs/api/foundation-auth.product.md +6 -8
- package/docs/api/foundation-auth.system.md +6 -7
- package/docs/api-report.md +29 -218
- package/package.json +13 -12
- package/dist/dts/user/config.d.ts +0 -29
- package/dist/dts/user/config.d.ts.map +0 -1
- package/dist/dts/user/user.d.ts +0 -233
- package/dist/dts/user/user.d.ts.map +0 -1
- package/dist/esm/user/config.js +0 -17
- package/dist/esm/user/user.js +0 -200
- package/docs/api/foundation-auth.defaultuser.actionhistory.md +0 -13
- package/docs/api/foundation-auth.defaultuser.addauthenticationchangelistener.md +0 -22
- package/docs/api/foundation-auth.defaultuser.clearactions.md +0 -17
- package/docs/api/foundation-auth.defaultuser.clearpaths.md +0 -17
- package/docs/api/foundation-auth.defaultuser.cleartrackinghistory.md +0 -16
- package/docs/api/foundation-auth.defaultuser.details.md +0 -12
- package/docs/api/foundation-auth.defaultuser.haspermission.md +0 -22
- package/docs/api/foundation-auth.defaultuser.hasprofile.md +0 -22
- package/docs/api/foundation-auth.defaultuser.isadmin.md +0 -16
- package/docs/api/foundation-auth.defaultuser.isanonymous.md +0 -12
- package/docs/api/foundation-auth.defaultuser.isauthenticated.md +0 -12
- package/docs/api/foundation-auth.defaultuser.isbanned.md +0 -16
- package/docs/api/foundation-auth.defaultuser.lastaction.md +0 -17
- package/docs/api/foundation-auth.defaultuser.lastpath.md +0 -19
- package/docs/api/foundation-auth.defaultuser.md +0 -50
- package/docs/api/foundation-auth.defaultuser.pathhistory.md +0 -13
- package/docs/api/foundation-auth.defaultuser.permission.md +0 -12
- package/docs/api/foundation-auth.defaultuser.profile.md +0 -12
- package/docs/api/foundation-auth.defaultuser.set.md +0 -22
- package/docs/api/foundation-auth.defaultuser.sourceref.md +0 -12
- package/docs/api/foundation-auth.defaultuser.trackaction.md +0 -24
- package/docs/api/foundation-auth.defaultuser.trackpath.md +0 -17
- package/docs/api/foundation-auth.defaultuser.unset.md +0 -16
- package/docs/api/foundation-auth.defaultuser.userkvs.md +0 -14
- package/docs/api/foundation-auth.defaultuser.username.md +0 -12
- package/docs/api/foundation-auth.defaultuserconfig.md +0 -13
- package/docs/api/foundation-auth.details.daystopasswordexpiry.md +0 -11
- package/docs/api/foundation-auth.details.failedloginattempts.md +0 -11
- package/docs/api/foundation-auth.details.heartbeatintervalsecs.md +0 -11
- package/docs/api/foundation-auth.details.lastlogindatetime.md +0 -11
- package/docs/api/foundation-auth.details.product.md +0 -11
- package/docs/api/foundation-auth.details.rejectedloginattempts.md +0 -11
- package/docs/api/foundation-auth.details.system.md +0 -11
- package/docs/api/foundation-auth.getuser.md +0 -30
- package/docs/api/foundation-auth.loginack.details.md +0 -11
- package/docs/api/foundation-auth.loginack.permission.md +0 -11
- package/docs/api/foundation-auth.loginack.profile.md +0 -11
- package/docs/api/foundation-auth.loginack.updatequeue.md +0 -11
- package/docs/api/foundation-auth.loginack.userkvs.md +0 -13
- package/docs/api/foundation-auth.loginack.username.md +0 -11
- package/docs/api/foundation-auth.loginack.zeromqproxyinboundport.md +0 -11
- package/docs/api/foundation-auth.loginack.zeromqproxymodeenabled.md +0 -11
- package/docs/api/foundation-auth.loginack.zeromqproxyoutboundport.md +0 -11
- package/docs/api/foundation-auth.product.name.md +0 -11
- package/docs/api/foundation-auth.product.version.md +0 -11
- package/docs/api/foundation-auth.system.date.md +0 -11
- package/docs/api/foundation-auth.user.addauthenticationchangelistener.md +0 -33
- package/docs/api/foundation-auth.user.cleartrackinghistory.md +0 -15
- package/docs/api/foundation-auth.user.details.md +0 -11
- package/docs/api/foundation-auth.user.haspermission.md +0 -22
- package/docs/api/foundation-auth.user.hasprofile.md +0 -22
- package/docs/api/foundation-auth.user.isadmin.md +0 -15
- package/docs/api/foundation-auth.user.isanonymous.md +0 -11
- package/docs/api/foundation-auth.user.isauthenticated.md +0 -11
- package/docs/api/foundation-auth.user.isbanned.md +0 -15
- package/docs/api/foundation-auth.user.md +0 -55
- package/docs/api/foundation-auth.user.permission.md +0 -11
- package/docs/api/foundation-auth.user.profile.md +0 -11
- package/docs/api/foundation-auth.user.set.md +0 -22
- package/docs/api/foundation-auth.user.sourceref.md +0 -11
- package/docs/api/foundation-auth.user.unset.md +0 -15
- package/docs/api/foundation-auth.user.userkvs.md +0 -13
- package/docs/api/foundation-auth.user.username.md +0 -11
- package/docs/api/foundation-auth.useractionhistory.actionhistory.md +0 -13
- package/docs/api/foundation-auth.useractionhistory.clearactions.md +0 -17
- package/docs/api/foundation-auth.useractionhistory.lastaction.md +0 -17
- package/docs/api/foundation-auth.useractionhistory.md +0 -32
- package/docs/api/foundation-auth.useractionhistory.trackaction.md +0 -24
- package/docs/api/foundation-auth.userauthenticationchangeevent.md +0 -18
- package/docs/api/foundation-auth.userauthenticationchangetype.md +0 -13
- package/docs/api/foundation-auth.userconfig.md +0 -21
- package/docs/api/foundation-auth.userconfig.trackactionexclusions.md +0 -13
- package/docs/api/foundation-auth.userconfig.trackpathexclusions.md +0 -13
- package/docs/api/foundation-auth.userpathhistory.clearpaths.md +0 -17
- package/docs/api/foundation-auth.userpathhistory.lastpath.md +0 -19
- package/docs/api/foundation-auth.userpathhistory.md +0 -32
- package/docs/api/foundation-auth.userpathhistory.pathhistory.md +0 -13
- package/docs/api/foundation-auth.userpathhistory.trackpath.md +0 -17
package/dist/esm/user/user.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { createObserver } from '@genesislcap/foundation-utils';
|
|
3
|
-
import { Observable, observable } from '@microsoft/fast-element';
|
|
4
|
-
import { DI } from '@microsoft/fast-foundation';
|
|
5
|
-
import { UserConfig } from './config';
|
|
6
|
-
/**
|
|
7
|
-
* UserAuthenticationChangeType.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export const UserAuthenticationChangeType = 'user-authentication-change';
|
|
11
|
-
/**
|
|
12
|
-
* Default User implementation.
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export class DefaultUser {
|
|
16
|
-
constructor() {
|
|
17
|
-
/** {@inheritDoc UserPathHistory.pathHistory} */
|
|
18
|
-
this.pathHistory = [];
|
|
19
|
-
/** {@inheritDoc UserActionHistory.actionHistory} */
|
|
20
|
-
this.actionHistory = [];
|
|
21
|
-
/** {@inheritDoc User.isAuthenticated} */
|
|
22
|
-
this.isAuthenticated = false;
|
|
23
|
-
/** @internal */
|
|
24
|
-
this.authenticationChangeListeners = createObserver();
|
|
25
|
-
}
|
|
26
|
-
/** {@inheritDoc User.set} */
|
|
27
|
-
set(entity) {
|
|
28
|
-
if (this.isAuthenticated) {
|
|
29
|
-
throw new Error(`Only AuthMachine should call User.set. If this is intentional, please call User.unset first.`);
|
|
30
|
-
}
|
|
31
|
-
this.userKVs = entity.userKVs;
|
|
32
|
-
this.details = entity.details;
|
|
33
|
-
this.permission = entity.permission;
|
|
34
|
-
this.profile = entity.profile;
|
|
35
|
-
this.sourceRef = entity.sourceRef;
|
|
36
|
-
this.userName = entity.userName;
|
|
37
|
-
this.isAuthenticated = true;
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
/** {@inheritDoc User.unset} */
|
|
41
|
-
unset() {
|
|
42
|
-
this.userKVs = undefined;
|
|
43
|
-
this.details = undefined;
|
|
44
|
-
this.permission = undefined;
|
|
45
|
-
this.profile = undefined;
|
|
46
|
-
this.sourceRef = undefined;
|
|
47
|
-
this.userName = undefined;
|
|
48
|
-
this.isAuthenticated = false;
|
|
49
|
-
return this;
|
|
50
|
-
}
|
|
51
|
-
/** @internal */
|
|
52
|
-
userNameChanged() {
|
|
53
|
-
Observable.notify(this, 'username');
|
|
54
|
-
}
|
|
55
|
-
/** {@inheritDoc User.username} */
|
|
56
|
-
get username() {
|
|
57
|
-
Observable.track(this, 'username');
|
|
58
|
-
return this.userName;
|
|
59
|
-
}
|
|
60
|
-
/** {@inheritDoc User.isAnonymous} */
|
|
61
|
-
get isAnonymous() {
|
|
62
|
-
return !this.isAuthenticated;
|
|
63
|
-
}
|
|
64
|
-
/** {@inheritDoc User.isAdmin} */
|
|
65
|
-
isAdmin() {
|
|
66
|
-
return this.hasProfile('ADMIN');
|
|
67
|
-
}
|
|
68
|
-
/** {@inheritDoc User.isBanned} */
|
|
69
|
-
isBanned() {
|
|
70
|
-
return this.hasProfile('BANNED');
|
|
71
|
-
}
|
|
72
|
-
/** {@inheritDoc User.hasPermission} */
|
|
73
|
-
hasPermission(permission) {
|
|
74
|
-
return this.hasKey(this.permission, permission);
|
|
75
|
-
}
|
|
76
|
-
/** {@inheritDoc User.hasProfile} */
|
|
77
|
-
hasProfile(profile) {
|
|
78
|
-
return this.hasKey(this.profile, profile);
|
|
79
|
-
}
|
|
80
|
-
/** {@inheritDoc UserPathHistory.trackPath} */
|
|
81
|
-
trackPath() {
|
|
82
|
-
const { pathname, search, hash } = location;
|
|
83
|
-
const path = `${pathname !== '/' ? pathname : ''}`;
|
|
84
|
-
const urlPath = `${path}${search}${hash}`;
|
|
85
|
-
if (this.config.trackPathExclusions.includes(urlPath)) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
this.pathHistory.push(urlPath);
|
|
89
|
-
return urlPath;
|
|
90
|
-
}
|
|
91
|
-
/** {@inheritDoc UserPathHistory.clearPaths} */
|
|
92
|
-
clearPaths() {
|
|
93
|
-
this.pathHistory = [];
|
|
94
|
-
}
|
|
95
|
-
/** {@inheritDoc UserPathHistory.lastPath} */
|
|
96
|
-
lastPath() {
|
|
97
|
-
const length = this.pathHistory.length;
|
|
98
|
-
return length > 0 ? this.pathHistory[length - 1] : undefined;
|
|
99
|
-
}
|
|
100
|
-
/** {@inheritDoc UserActionHistory.trackAction} */
|
|
101
|
-
trackAction(details) {
|
|
102
|
-
if (this.config.trackActionExclusions.includes(details)) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
this.actionHistory.push(details);
|
|
106
|
-
}
|
|
107
|
-
/** {@inheritDoc UserActionHistory.clearActions} */
|
|
108
|
-
clearActions() {
|
|
109
|
-
this.actionHistory = [];
|
|
110
|
-
}
|
|
111
|
-
/** {@inheritDoc UserActionHistory.lastAction} */
|
|
112
|
-
lastAction() {
|
|
113
|
-
const length = this.actionHistory.length;
|
|
114
|
-
return length > 0 ? this.actionHistory[length - 1] : undefined;
|
|
115
|
-
}
|
|
116
|
-
/** {@inheritDoc User.clearTrackingHistory} */
|
|
117
|
-
clearTrackingHistory() {
|
|
118
|
-
this.clearPaths();
|
|
119
|
-
this.clearActions();
|
|
120
|
-
}
|
|
121
|
-
/** @internal */
|
|
122
|
-
hasKey(keys, key) {
|
|
123
|
-
if (!keys || !keys.length || !key) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
if (!Array.isArray(key)) {
|
|
127
|
-
key = [key];
|
|
128
|
-
}
|
|
129
|
-
return key.some((k) => keys.includes(k));
|
|
130
|
-
}
|
|
131
|
-
/** {@inheritDoc User.addAuthenticationChangeListener} */
|
|
132
|
-
addAuthenticationChangeListener(listener) {
|
|
133
|
-
var _a;
|
|
134
|
-
return (_a = this.authenticationChangeListeners) === null || _a === void 0 ? void 0 : _a.subscribe(listener);
|
|
135
|
-
}
|
|
136
|
-
/** @internal */
|
|
137
|
-
isAuthenticatedChanged() {
|
|
138
|
-
var _a;
|
|
139
|
-
(_a = this.authenticationChangeListeners) === null || _a === void 0 ? void 0 : _a.publish(new CustomEvent(UserAuthenticationChangeType, {
|
|
140
|
-
detail: this.isAuthenticated,
|
|
141
|
-
}));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
__decorate([
|
|
145
|
-
UserConfig
|
|
146
|
-
], DefaultUser.prototype, "config", void 0);
|
|
147
|
-
__decorate([
|
|
148
|
-
observable
|
|
149
|
-
], DefaultUser.prototype, "pathHistory", void 0);
|
|
150
|
-
__decorate([
|
|
151
|
-
observable
|
|
152
|
-
], DefaultUser.prototype, "actionHistory", void 0);
|
|
153
|
-
__decorate([
|
|
154
|
-
observable
|
|
155
|
-
], DefaultUser.prototype, "isAuthenticated", void 0);
|
|
156
|
-
__decorate([
|
|
157
|
-
observable
|
|
158
|
-
], DefaultUser.prototype, "userKVs", void 0);
|
|
159
|
-
__decorate([
|
|
160
|
-
observable
|
|
161
|
-
], DefaultUser.prototype, "details", void 0);
|
|
162
|
-
__decorate([
|
|
163
|
-
observable
|
|
164
|
-
], DefaultUser.prototype, "permission", void 0);
|
|
165
|
-
__decorate([
|
|
166
|
-
observable
|
|
167
|
-
], DefaultUser.prototype, "profile", void 0);
|
|
168
|
-
__decorate([
|
|
169
|
-
observable
|
|
170
|
-
], DefaultUser.prototype, "sourceRef", void 0);
|
|
171
|
-
__decorate([
|
|
172
|
-
observable
|
|
173
|
-
], DefaultUser.prototype, "userName", void 0);
|
|
174
|
-
/**
|
|
175
|
-
* User DI key.
|
|
176
|
-
*
|
|
177
|
-
* @privateRemarks
|
|
178
|
-
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
179
|
-
*
|
|
180
|
-
* @internal
|
|
181
|
-
*/
|
|
182
|
-
export const User = DI.createInterface((x) => x.singleton(DefaultUser));
|
|
183
|
-
/**
|
|
184
|
-
* Gets User from the DI container.
|
|
185
|
-
*
|
|
186
|
-
* @remarks
|
|
187
|
-
* A utility method for host applications that are not using decorators or the DI container.
|
|
188
|
-
*
|
|
189
|
-
* @example
|
|
190
|
-
* ```ts
|
|
191
|
-
* import { getUser, User } from '@genesislcap/foundation-auth/user';
|
|
192
|
-
* ...
|
|
193
|
-
* private user: User = getUser();
|
|
194
|
-
* ```
|
|
195
|
-
*
|
|
196
|
-
* @public
|
|
197
|
-
*/
|
|
198
|
-
export function getUser() {
|
|
199
|
-
return DI.getOrCreateDOMContainer().get(User);
|
|
200
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [actionHistory](./foundation-auth.defaultuser.actionhistory.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.actionHistory property
|
|
6
|
-
|
|
7
|
-
Array of actions that have been tracked.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
actionHistory: unknown[];
|
|
13
|
-
```
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [addAuthenticationChangeListener](./foundation-auth.defaultuser.addauthenticationchangelistener.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.addAuthenticationChangeListener() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
addAuthenticationChangeListener(listener: Listener<UserAuthenticationChangeEvent>): () => void;
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Parameters
|
|
14
|
-
|
|
15
|
-
| Parameter | Type | Description |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| listener | Listener<[UserAuthenticationChangeEvent](./foundation-auth.userauthenticationchangeevent.md)<!-- -->> | A listener function. |
|
|
18
|
-
|
|
19
|
-
**Returns:**
|
|
20
|
-
|
|
21
|
-
() => void
|
|
22
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [clearActions](./foundation-auth.defaultuser.clearactions.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.clearActions() method
|
|
6
|
-
|
|
7
|
-
Clears action history.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
clearActions(): void;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
void
|
|
17
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [clearPaths](./foundation-auth.defaultuser.clearpaths.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.clearPaths() method
|
|
6
|
-
|
|
7
|
-
Clears path history.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
clearPaths(): void;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
void
|
|
17
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [clearTrackingHistory](./foundation-auth.defaultuser.cleartrackinghistory.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.clearTrackingHistory() method
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
clearTrackingHistory(): void;
|
|
12
|
-
```
|
|
13
|
-
**Returns:**
|
|
14
|
-
|
|
15
|
-
void
|
|
16
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [details](./foundation-auth.defaultuser.details.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.details property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
details: Details;
|
|
12
|
-
```
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [hasPermission](./foundation-auth.defaultuser.haspermission.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.hasPermission() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
hasPermission(permission: string | string[]): boolean;
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Parameters
|
|
14
|
-
|
|
15
|
-
| Parameter | Type | Description |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| permission | string \| string\[\] | A permission string or an array of permission strings to check. |
|
|
18
|
-
|
|
19
|
-
**Returns:**
|
|
20
|
-
|
|
21
|
-
boolean
|
|
22
|
-
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [hasProfile](./foundation-auth.defaultuser.hasprofile.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.hasProfile() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
hasProfile(profile: string | string[]): boolean;
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Parameters
|
|
14
|
-
|
|
15
|
-
| Parameter | Type | Description |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| profile | string \| string\[\] | A profile string or an array of profile strings to check. |
|
|
18
|
-
|
|
19
|
-
**Returns:**
|
|
20
|
-
|
|
21
|
-
boolean
|
|
22
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [isAdmin](./foundation-auth.defaultuser.isadmin.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.isAdmin() method
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
isAdmin(): boolean;
|
|
12
|
-
```
|
|
13
|
-
**Returns:**
|
|
14
|
-
|
|
15
|
-
boolean
|
|
16
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [isAnonymous](./foundation-auth.defaultuser.isanonymous.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.isAnonymous property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
get isAnonymous(): boolean;
|
|
12
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [isAuthenticated](./foundation-auth.defaultuser.isauthenticated.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.isAuthenticated property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
isAuthenticated: boolean;
|
|
12
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [isBanned](./foundation-auth.defaultuser.isbanned.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.isBanned() method
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
isBanned(): boolean;
|
|
12
|
-
```
|
|
13
|
-
**Returns:**
|
|
14
|
-
|
|
15
|
-
boolean
|
|
16
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [lastAction](./foundation-auth.defaultuser.lastaction.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.lastAction() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
lastAction(): unknown;
|
|
11
|
-
```
|
|
12
|
-
**Returns:**
|
|
13
|
-
|
|
14
|
-
unknown
|
|
15
|
-
|
|
16
|
-
The last stored action.
|
|
17
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [lastPath](./foundation-auth.defaultuser.lastpath.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.lastPath() method
|
|
6
|
-
|
|
7
|
-
May be used to return to a target path after authentication.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
lastPath(): string;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
string
|
|
17
|
-
|
|
18
|
-
The last stored path.
|
|
19
|
-
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser class
|
|
6
|
-
|
|
7
|
-
Default User implementation.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare class DefaultUser implements User
|
|
13
|
-
```
|
|
14
|
-
**Implements:** [User](./foundation-auth.user.md)
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [actionHistory](./foundation-auth.defaultuser.actionhistory.md) | | unknown\[\] | Array of actions that have been tracked. |
|
|
21
|
-
| [details](./foundation-auth.defaultuser.details.md) | | [Details](./foundation-auth.details.md) | |
|
|
22
|
-
| [isAnonymous](./foundation-auth.defaultuser.isanonymous.md) | <code>readonly</code> | boolean | |
|
|
23
|
-
| [isAuthenticated](./foundation-auth.defaultuser.isauthenticated.md) | | boolean | |
|
|
24
|
-
| [pathHistory](./foundation-auth.defaultuser.pathhistory.md) | | string\[\] | Array of paths that have been tracked. |
|
|
25
|
-
| [permission](./foundation-auth.defaultuser.permission.md) | | string\[\] | |
|
|
26
|
-
| [profile](./foundation-auth.defaultuser.profile.md) | | string\[\] | |
|
|
27
|
-
| [sourceRef](./foundation-auth.defaultuser.sourceref.md) | | string | |
|
|
28
|
-
| [userKVs](./foundation-auth.defaultuser.userkvs.md) | | { \[key: string\]: any; } | |
|
|
29
|
-
| [username](./foundation-auth.defaultuser.username.md) | <code>readonly</code> | string | |
|
|
30
|
-
| [userName](./foundation-auth.defaultuser.username.md) | | string | |
|
|
31
|
-
|
|
32
|
-
## Methods
|
|
33
|
-
|
|
34
|
-
| Method | Modifiers | Description |
|
|
35
|
-
| --- | --- | --- |
|
|
36
|
-
| [addAuthenticationChangeListener(listener)](./foundation-auth.defaultuser.addauthenticationchangelistener.md) | | |
|
|
37
|
-
| [clearActions()](./foundation-auth.defaultuser.clearactions.md) | | Clears action history. |
|
|
38
|
-
| [clearPaths()](./foundation-auth.defaultuser.clearpaths.md) | | Clears path history. |
|
|
39
|
-
| [clearTrackingHistory()](./foundation-auth.defaultuser.cleartrackinghistory.md) | | |
|
|
40
|
-
| [hasPermission(permission)](./foundation-auth.defaultuser.haspermission.md) | | |
|
|
41
|
-
| [hasProfile(profile)](./foundation-auth.defaultuser.hasprofile.md) | | |
|
|
42
|
-
| [isAdmin()](./foundation-auth.defaultuser.isadmin.md) | | |
|
|
43
|
-
| [isBanned()](./foundation-auth.defaultuser.isbanned.md) | | |
|
|
44
|
-
| [lastAction()](./foundation-auth.defaultuser.lastaction.md) | | |
|
|
45
|
-
| [lastPath()](./foundation-auth.defaultuser.lastpath.md) | | May be used to return to a target path after authentication. |
|
|
46
|
-
| [set(entity)](./foundation-auth.defaultuser.set.md) | | |
|
|
47
|
-
| [trackAction(details)](./foundation-auth.defaultuser.trackaction.md) | | Track an action. |
|
|
48
|
-
| [trackPath()](./foundation-auth.defaultuser.trackpath.md) | | Track current path. |
|
|
49
|
-
| [unset()](./foundation-auth.defaultuser.unset.md) | | |
|
|
50
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [pathHistory](./foundation-auth.defaultuser.pathhistory.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.pathHistory property
|
|
6
|
-
|
|
7
|
-
Array of paths that have been tracked.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
pathHistory: string[];
|
|
13
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [permission](./foundation-auth.defaultuser.permission.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.permission property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
permission: string[];
|
|
12
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [profile](./foundation-auth.defaultuser.profile.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.profile property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
profile: string[];
|
|
12
|
-
```
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [set](./foundation-auth.defaultuser.set.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.set() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
set(entity: Partial<LoginAck>): this;
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Parameters
|
|
14
|
-
|
|
15
|
-
| Parameter | Type | Description |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| entity | Partial<[LoginAck](./foundation-auth.loginack.md)<!-- -->> | The LoginAck used to populate the User. |
|
|
18
|
-
|
|
19
|
-
**Returns:**
|
|
20
|
-
|
|
21
|
-
this
|
|
22
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [sourceRef](./foundation-auth.defaultuser.sourceref.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.sourceRef property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
sourceRef: string;
|
|
12
|
-
```
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [trackAction](./foundation-auth.defaultuser.trackaction.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.trackAction() method
|
|
6
|
-
|
|
7
|
-
Track an action.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
trackAction<TDetails = unknown>(details: TDetails): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
| Parameter | Type | Description |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| details | TDetails | |
|
|
20
|
-
|
|
21
|
-
**Returns:**
|
|
22
|
-
|
|
23
|
-
void
|
|
24
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [trackPath](./foundation-auth.defaultuser.trackpath.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.trackPath() method
|
|
6
|
-
|
|
7
|
-
Track current path.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
trackPath(): string;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
string
|
|
17
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [unset](./foundation-auth.defaultuser.unset.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.unset() method
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
unset(): this;
|
|
12
|
-
```
|
|
13
|
-
**Returns:**
|
|
14
|
-
|
|
15
|
-
this
|
|
16
|
-
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [userKVs](./foundation-auth.defaultuser.userkvs.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.userKVs property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
userKVs: {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
14
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-auth](./foundation-auth.md) > [DefaultUser](./foundation-auth.defaultuser.md) > [userName](./foundation-auth.defaultuser.username.md)
|
|
4
|
-
|
|
5
|
-
## DefaultUser.userName property
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
userName: string;
|
|
12
|
-
```
|