@memberjunction/core-entities-server 6.2.0-edge.5 → 6.2.0-edge.6
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/dist/custom/MJAIAgentSessionEntityServer.server.d.ts +9 -26
- package/dist/custom/MJAIAgentSessionEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentSessionEntityServer.server.js +21 -44
- package/dist/custom/MJAIAgentSessionEntityServer.server.js.map +1 -1
- package/dist/custom/MJComponentEntityServer.server.d.ts +9 -0
- package/dist/custom/MJComponentEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJComponentEntityServer.server.js +25 -1
- package/dist/custom/MJComponentEntityServer.server.js.map +1 -1
- package/dist/custom/MJConversationEntityServer.server.d.ts +13 -0
- package/dist/custom/MJConversationEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJConversationEntityServer.server.js +33 -0
- package/dist/custom/MJConversationEntityServer.server.js.map +1 -0
- package/dist/custom/MJDashboardEntityServer.server.d.ts +14 -0
- package/dist/custom/MJDashboardEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJDashboardEntityServer.server.js +38 -0
- package/dist/custom/MJDashboardEntityServer.server.js.map +1 -0
- package/dist/custom/MJDuplicateRunEntityServer.server.d.ts +34 -2
- package/dist/custom/MJDuplicateRunEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJDuplicateRunEntityServer.server.js +103 -23
- package/dist/custom/MJDuplicateRunEntityServer.server.js.map +1 -1
- package/dist/custom/MJEntityAlternateBaseViewEntityServer.server.d.ts +73 -0
- package/dist/custom/MJEntityAlternateBaseViewEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJEntityAlternateBaseViewEntityServer.server.js +391 -0
- package/dist/custom/MJEntityAlternateBaseViewEntityServer.server.js.map +1 -0
- package/dist/custom/MJEntityFieldPermissionEntityServer.server.d.ts +96 -22
- package/dist/custom/MJEntityFieldPermissionEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJEntityFieldPermissionEntityServer.server.js +239 -55
- package/dist/custom/MJEntityFieldPermissionEntityServer.server.js.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.d.ts +8 -0
- package/dist/custom/MJQueryEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.js +45 -2
- package/dist/custom/MJQueryEntityServer.server.js.map +1 -1
- package/dist/custom/MJUserRoleEntityServer.server.d.ts +74 -7
- package/dist/custom/MJUserRoleEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserRoleEntityServer.server.js +206 -20
- package/dist/custom/MJUserRoleEntityServer.server.js.map +1 -1
- package/dist/custom/MJUserViewEntityServer.server.d.ts +17 -1
- package/dist/custom/MJUserViewEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserViewEntityServer.server.js +95 -7
- package/dist/custom/MJUserViewEntityServer.server.js.map +1 -1
- package/dist/custom/MJVectorIndexEntityServer.server.d.ts +2 -0
- package/dist/custom/MJVectorIndexEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJVectorIndexEntityServer.server.js +33 -0
- package/dist/custom/MJVectorIndexEntityServer.server.js.map +1 -1
- package/dist/custom/anonymousOwnershipKeyGuard.d.ts +42 -0
- package/dist/custom/anonymousOwnershipKeyGuard.d.ts.map +1 -0
- package/dist/custom/anonymousOwnershipKeyGuard.js +36 -0
- package/dist/custom/anonymousOwnershipKeyGuard.js.map +1 -0
- package/dist/custom/approvalStamp.d.ts +37 -0
- package/dist/custom/approvalStamp.d.ts.map +1 -0
- package/dist/custom/approvalStamp.js +67 -0
- package/dist/custom/approvalStamp.js.map +1 -0
- package/dist/custom/fieldPermissionAccess.d.ts +31 -0
- package/dist/custom/fieldPermissionAccess.d.ts.map +1 -0
- package/dist/custom/fieldPermissionAccess.js +38 -0
- package/dist/custom/fieldPermissionAccess.js.map +1 -0
- package/dist/custom/fieldPermissionReconciler.d.ts.map +1 -1
- package/dist/custom/fieldPermissionReconciler.js +12 -2
- package/dist/custom/fieldPermissionReconciler.js.map +1 -1
- package/dist/custom/query-extraction/resolve.d.ts.map +1 -1
- package/dist/custom/query-extraction/resolve.js +25 -7
- package/dist/custom/query-extraction/resolve.js.map +1 -1
- package/dist/custom/query-extraction/sync.d.ts +1 -1
- package/dist/custom/query-extraction/sync.d.ts.map +1 -1
- package/dist/custom/query-extraction/sync.js +84 -21
- package/dist/custom/query-extraction/sync.js.map +1 -1
- package/dist/custom/query-extraction/types.d.ts +4 -0
- package/dist/custom/query-extraction/types.d.ts.map +1 -1
- package/dist/custom/systemUserGuardState.d.ts +73 -0
- package/dist/custom/systemUserGuardState.d.ts.map +1 -0
- package/dist/custom/systemUserGuardState.js +161 -0
- package/dist/custom/systemUserGuardState.js.map +1 -0
- package/dist/custom/template-extraction/parser.js +5 -2
- package/dist/custom/template-extraction/parser.js.map +1 -1
- package/dist/custom/template-extraction/types.d.ts +1 -1
- package/dist/custom/template-extraction/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +30 -30
|
@@ -75,7 +75,7 @@ import { MJUserRoleEntity } from '@memberjunction/core-entities';
|
|
|
75
75
|
* `CloneUserForSessionContext` carries it onto the per-session clone.)
|
|
76
76
|
*
|
|
77
77
|
* NOT COVERED, deliberately: a magic-link session's SYNTHESIZED roles (`context.ts`
|
|
78
|
-
* `
|
|
78
|
+
* `BuildMagicLinkSessionUser`) count as roles held, so a scope-limited principal is measured by the
|
|
79
79
|
* same rule as any other caller. Narrowing scope-limited principals further is a magic-link concern,
|
|
80
80
|
* not a role-elevation one — `IsScopeLimitedPrincipal` lives in MJServer, which this package cannot
|
|
81
81
|
* import, and duplicating its predicate here would put one decision in two places. Such a session
|
|
@@ -110,6 +110,9 @@ import { MJUserRoleEntity } from '@memberjunction/core-entities';
|
|
|
110
110
|
* short of its entity-level access. Removal is the opposite shape: it drops rules OUT of the
|
|
111
111
|
* aggregate, so what matters is not what the departing role said but whether an `Allow` survives
|
|
112
112
|
* without it.
|
|
113
|
+
* - **Re-pointing** ({@link Save}) — an UPDATE that changes `UserID` or `RoleID` on an existing
|
|
114
|
+
* row takes its OLD (user, role) pair apart exactly as a delete would, so the removal check runs
|
|
115
|
+
* against the pair being vacated. `Validate()` already checks the new pair as an assignment.
|
|
113
116
|
*
|
|
114
117
|
* Why the system user must stay unrestricted: the server runs background work as that account.
|
|
115
118
|
* It pre-warms the shared engine caches at startup, and in task mode — which job and agent
|
|
@@ -119,14 +122,20 @@ import { MJUserRoleEntity } from '@memberjunction/core-entities';
|
|
|
119
122
|
* cache that everyone reads afterward, with nothing at the point of failure pointing back at
|
|
120
123
|
* the role assignment that caused it.
|
|
121
124
|
*
|
|
122
|
-
* Unlike guard A, guard B
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
+
* Unlike guard A, guard B is not pure. `Validate()` checks an assignment against cached metadata
|
|
126
|
+
* so a form can show the reason early, but the deciding checks run in `Save()` and `Delete()` on
|
|
127
|
+
* the system user's role set and field rules as stored in the database (`systemUserGuardState`),
|
|
128
|
+
* because the caches lag a write made a moment before. They run for a `ReplayOnly` save too. A
|
|
129
|
+
* transaction group holding this and another guarded write that concerns the system user is
|
|
130
|
+
* refused, since neither check could see the other's change. A cold `UserCache` (no system user
|
|
131
|
+
* to identify) skips the check rather than blocking an administrator.
|
|
125
132
|
*
|
|
126
133
|
* This restricts CONFIGURATION only. There is no user who is exempt from a Deny at runtime —
|
|
127
134
|
* not even the system user, whose access comes from the same rows as everyone else's.
|
|
128
135
|
*/
|
|
129
136
|
export declare class MJUserRoleEntityServer extends MJUserRoleEntity {
|
|
137
|
+
/** This write's place in its transaction group, held from guard B's group check until the write enrols. */
|
|
138
|
+
private pendingGroupWrite;
|
|
130
139
|
Validate(): ValidationResult;
|
|
131
140
|
/**
|
|
132
141
|
* Refuses a `ReplayOnly` save by a non-Owner caller — invariant 4. `ReplayOnly` force-passes
|
|
@@ -136,6 +145,51 @@ export declare class MJUserRoleEntityServer extends MJUserRoleEntity {
|
|
|
136
145
|
* `MJUserEntityServer.Save()`, including its reasoning for refusing rather than re-validating.
|
|
137
146
|
*/
|
|
138
147
|
Save(options?: EntitySaveOptions): Promise<boolean>;
|
|
148
|
+
/**
|
|
149
|
+
* Ends this write's hold on the group place guard B reserved: kept when the write enrolled,
|
|
150
|
+
* given back when it was refused, returned false or threw, so a retry is not counted twice.
|
|
151
|
+
*/
|
|
152
|
+
private settleGroupWrite;
|
|
153
|
+
/**
|
|
154
|
+
* Guard B for a save, judged on the database rather than the caches: a transaction group
|
|
155
|
+
* holding this and another guarded write that concerns the system user is refused; an update
|
|
156
|
+
* that re-points the row is checked as a removal of the pair it leaves; and an assignment of
|
|
157
|
+
* a role to the system user is refused when that role carries a stored `Deny`. A read that
|
|
158
|
+
* fails refuses the save.
|
|
159
|
+
*/
|
|
160
|
+
private systemUserSaveRejection;
|
|
161
|
+
/**
|
|
162
|
+
* Why assigning this row's role to the system user is refused on the rules as stored now, or
|
|
163
|
+
* null. Only a create or a re-point assigns; an update that keeps the pair assigns nothing new.
|
|
164
|
+
*/
|
|
165
|
+
private storedAssignmentRejectionReason;
|
|
166
|
+
/** Whether this update moves the row to a different (user, role) pair. Unknown prior values count as a move. */
|
|
167
|
+
private isRepoint;
|
|
168
|
+
/** Names of the entities owning the given fields, from loaded metadata, each once. */
|
|
169
|
+
private static entityNamesForFieldIDs;
|
|
170
|
+
/** The refusal when the system user's field access cannot be checked because a read failed. */
|
|
171
|
+
private static unverifiableMessage;
|
|
172
|
+
/**
|
|
173
|
+
* Why re-pointing this assignment away from its stored (user, role) pair would cost the MJ
|
|
174
|
+
* system user field access, or null when it would not.
|
|
175
|
+
*
|
|
176
|
+
* Evaluated as a removal of the OLD pair with nothing added in its place. When `RoleID` moves
|
|
177
|
+
* between two roles on the system user that is conservative — the incoming role might hold the
|
|
178
|
+
* very `Allow` the outgoing one is taking away — but assigning the new role first and then
|
|
179
|
+
* deleting the old one reaches the same state through checks that can each see the whole
|
|
180
|
+
* picture.
|
|
181
|
+
*
|
|
182
|
+
* A re-pointed column whose prior value cannot be established fails CLOSED while there is a
|
|
183
|
+
* system user to protect: the vacated pair might be one of its roles.
|
|
184
|
+
*/
|
|
185
|
+
private vacatedPairRemovalReason;
|
|
186
|
+
/**
|
|
187
|
+
* Why removing this row's STORED (user, role) pair would cost the system user field access,
|
|
188
|
+
* or null. Shared by the delete path and the re-point path, which take the same pair apart.
|
|
189
|
+
*/
|
|
190
|
+
private storedPairRemovalReason;
|
|
191
|
+
/** A column's stored value; undefined when it is dirty and its old value is not a usable ID. */
|
|
192
|
+
private priorValue;
|
|
139
193
|
/**
|
|
140
194
|
* Enforces both guards on the delete path.
|
|
141
195
|
*
|
|
@@ -159,6 +213,13 @@ export declare class MJUserRoleEntityServer extends MJUserRoleEntity {
|
|
|
159
213
|
* Owner, so it is exempt from guard A and never sees that refusal on a default install.
|
|
160
214
|
*/
|
|
161
215
|
Delete(options?: EntityDeleteOptions): Promise<boolean>;
|
|
216
|
+
/**
|
|
217
|
+
* Guard B's transaction-group rule for this write. When it passes, the write's place in the
|
|
218
|
+
* group is reserved in the same step, so a second guarded write in flight at once sees it.
|
|
219
|
+
*/
|
|
220
|
+
private groupRefusal;
|
|
221
|
+
/** Guard B for a delete: the transaction-group rule, then the removal check on stored state. */
|
|
222
|
+
private systemUserDeleteRejection;
|
|
162
223
|
/**
|
|
163
224
|
* Invariants 1 and 2's forward half — the role being assigned must be one the caller holds.
|
|
164
225
|
* Attributed to `RoleID` because that IS the field whose value is refused, so a form highlights
|
|
@@ -205,8 +266,11 @@ export declare class MJUserRoleEntityServer extends MJUserRoleEntity {
|
|
|
205
266
|
*/
|
|
206
267
|
private callerIsOwner;
|
|
207
268
|
/**
|
|
208
|
-
* Why
|
|
209
|
-
* Only ever rejects for the system user; every other user is unaffected.
|
|
269
|
+
* Why taking `roleID` off `userID` would cost the system user field access, or null when it
|
|
270
|
+
* would not. Only ever rejects for the system user; every other user is unaffected.
|
|
271
|
+
*
|
|
272
|
+
* Parameterized because the delete path and the re-point path both ask about the pair as
|
|
273
|
+
* STORED, which on a re-point is only available from the dirty fields' old values.
|
|
210
274
|
*/
|
|
211
275
|
private systemUserRoleRemovalReason;
|
|
212
276
|
/**
|
|
@@ -214,9 +278,12 @@ export declare class MJUserRoleEntityServer extends MJUserRoleEntity {
|
|
|
214
278
|
* Only ever rejects for the system user; every other user is unaffected.
|
|
215
279
|
*/
|
|
216
280
|
static SystemUserRejectionReason(userID: string | null, roleID: string | null, provider?: IMetadataProvider): string | null;
|
|
281
|
+
/** The refusal for assigning the system user a role that denies a field on the named entities. */
|
|
282
|
+
private static assignmentRejectionMessage;
|
|
217
283
|
/**
|
|
218
284
|
* Names of entities where this role carries at least one RESTRICTING field rule — a `Deny`
|
|
219
|
-
* on any verb
|
|
285
|
+
* on any verb, under any spelling (the column's collation stores `'deny'` too, and enforcement
|
|
286
|
+
* honors it). Walks cached metadata only — no database access. Runs only when the system
|
|
220
287
|
* user is the save target, which is rare.
|
|
221
288
|
*
|
|
222
289
|
* Grants and neutrals are ignored, and must be: the system user holds the standard roles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJUserRoleEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJUserRoleEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,mBAAmB,EAEnB,iBAAiB,EACjB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"MJUserRoleEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJUserRoleEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,mBAAmB,EAEnB,iBAAiB,EACjB,iBAAiB,EAKjB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAkBjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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iBAAiB,GAAG,MAAM,GAAG,IAAI;IAkBlI,kGAAkG;IAClG,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAWzC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,MAAM,CAAC,wCAAwC;CAe1D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD"}
|
|
@@ -5,10 +5,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var MJUserRoleEntityServer_1;
|
|
8
|
-
import { BaseEntity, BaseEntityResult,
|
|
9
|
-
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
|
|
8
|
+
import { BaseEntity, BaseEntityResult, Metadata, ValidationErrorInfo, ValidationErrorType, } from '@memberjunction/core';
|
|
9
|
+
import { RegisterClass, UUIDSet, UUIDsEqual } from '@memberjunction/global';
|
|
10
10
|
import { MJUserRoleEntity } from '@memberjunction/core-entities';
|
|
11
|
-
import {
|
|
11
|
+
import { UserCache } from '@memberjunction/generic-database-provider';
|
|
12
|
+
import { IsRestrictingFieldRuleAnyCase } from './fieldPermissionAccess.js';
|
|
13
|
+
import { GuardedTransactionGroupRefusal, IsSystemUserID, ReleaseGuardedTransactionGroupWrite, ReserveGuardedTransactionGroupWrite, StoredRestrictingFieldIDsForRole, StoredRoleRemovalViolations, } from './systemUserGuardState.js';
|
|
14
|
+
const UNDETERMINED_PRIOR_ASSIGNMENT_MESSAGE = 'Could not determine which user and role this assignment granted before the edit, so the change cannot be ' +
|
|
15
|
+
"checked against the MJ system user's field access. Refusing to save rather than risk removing a role the " +
|
|
16
|
+
'server depends on. Reload the record and try again.';
|
|
12
17
|
/**
|
|
13
18
|
* Server-side `MJ: User Roles` entity. It carries TWO independent guards that happen to protect the
|
|
14
19
|
* same table from opposite directions. They share no state and no helpers, and every write path
|
|
@@ -84,7 +89,7 @@ import { FindSystemUserFieldAccessViolations, UserCache } from '@memberjunction/
|
|
|
84
89
|
* `CloneUserForSessionContext` carries it onto the per-session clone.)
|
|
85
90
|
*
|
|
86
91
|
* NOT COVERED, deliberately: a magic-link session's SYNTHESIZED roles (`context.ts`
|
|
87
|
-
* `
|
|
92
|
+
* `BuildMagicLinkSessionUser`) count as roles held, so a scope-limited principal is measured by the
|
|
88
93
|
* same rule as any other caller. Narrowing scope-limited principals further is a magic-link concern,
|
|
89
94
|
* not a role-elevation one — `IsScopeLimitedPrincipal` lives in MJServer, which this package cannot
|
|
90
95
|
* import, and duplicating its predicate here would put one decision in two places. Such a session
|
|
@@ -119,6 +124,9 @@ import { FindSystemUserFieldAccessViolations, UserCache } from '@memberjunction/
|
|
|
119
124
|
* short of its entity-level access. Removal is the opposite shape: it drops rules OUT of the
|
|
120
125
|
* aggregate, so what matters is not what the departing role said but whether an `Allow` survives
|
|
121
126
|
* without it.
|
|
127
|
+
* - **Re-pointing** ({@link Save}) — an UPDATE that changes `UserID` or `RoleID` on an existing
|
|
128
|
+
* row takes its OLD (user, role) pair apart exactly as a delete would, so the removal check runs
|
|
129
|
+
* against the pair being vacated. `Validate()` already checks the new pair as an assignment.
|
|
122
130
|
*
|
|
123
131
|
* Why the system user must stay unrestricted: the server runs background work as that account.
|
|
124
132
|
* It pre-warms the shared engine caches at startup, and in task mode — which job and agent
|
|
@@ -128,14 +136,23 @@ import { FindSystemUserFieldAccessViolations, UserCache } from '@memberjunction/
|
|
|
128
136
|
* cache that everyone reads afterward, with nothing at the point of failure pointing back at
|
|
129
137
|
* the role assignment that caused it.
|
|
130
138
|
*
|
|
131
|
-
* Unlike guard A, guard B
|
|
132
|
-
*
|
|
133
|
-
*
|
|
139
|
+
* Unlike guard A, guard B is not pure. `Validate()` checks an assignment against cached metadata
|
|
140
|
+
* so a form can show the reason early, but the deciding checks run in `Save()` and `Delete()` on
|
|
141
|
+
* the system user's role set and field rules as stored in the database (`systemUserGuardState`),
|
|
142
|
+
* because the caches lag a write made a moment before. They run for a `ReplayOnly` save too. A
|
|
143
|
+
* transaction group holding this and another guarded write that concerns the system user is
|
|
144
|
+
* refused, since neither check could see the other's change. A cold `UserCache` (no system user
|
|
145
|
+
* to identify) skips the check rather than blocking an administrator.
|
|
134
146
|
*
|
|
135
147
|
* This restricts CONFIGURATION only. There is no user who is exempt from a Deny at runtime —
|
|
136
148
|
* not even the system user, whose access comes from the same rows as everyone else's.
|
|
137
149
|
*/
|
|
138
150
|
let MJUserRoleEntityServer = MJUserRoleEntityServer_1 = class MJUserRoleEntityServer extends MJUserRoleEntity {
|
|
151
|
+
constructor() {
|
|
152
|
+
super(...arguments);
|
|
153
|
+
/** This write's place in its transaction group, held from guard B's group check until the write enrols. */
|
|
154
|
+
this.pendingGroupWrite = null;
|
|
155
|
+
}
|
|
139
156
|
Validate() {
|
|
140
157
|
const result = super.Validate();
|
|
141
158
|
// Guard A — the caller may only assign/move a role they hold themselves.
|
|
@@ -168,7 +185,131 @@ let MJUserRoleEntityServer = MJUserRoleEntityServer_1 = class MJUserRoleEntitySe
|
|
|
168
185
|
return this.refuse(this.IsSaved ? 'update' : 'create', 'Only an Owner may perform a ReplayOnly save on a user-role assignment. ReplayOnly bypasses ' +
|
|
169
186
|
'validation, which is where this entity\'s role-elevation invariants are enforced.');
|
|
170
187
|
}
|
|
171
|
-
|
|
188
|
+
// Guard B on the save path. Not only in Validate(): a ReplayOnly save skips Validate(), and
|
|
189
|
+
// an Owner may replay — this check has no Owner exemption, so it must run either way.
|
|
190
|
+
let saved = false;
|
|
191
|
+
try {
|
|
192
|
+
const rejection = await this.systemUserSaveRejection();
|
|
193
|
+
if (rejection) {
|
|
194
|
+
return this.refuse(this.IsSaved ? 'update' : 'create', rejection);
|
|
195
|
+
}
|
|
196
|
+
saved = await super.Save(options);
|
|
197
|
+
return saved;
|
|
198
|
+
}
|
|
199
|
+
finally {
|
|
200
|
+
this.settleGroupWrite(saved);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Ends this write's hold on the group place guard B reserved: kept when the write enrolled,
|
|
205
|
+
* given back when it was refused, returned false or threw, so a retry is not counted twice.
|
|
206
|
+
*/
|
|
207
|
+
settleGroupWrite(enrolled) {
|
|
208
|
+
const pending = this.pendingGroupWrite;
|
|
209
|
+
this.pendingGroupWrite = null;
|
|
210
|
+
if (!enrolled) {
|
|
211
|
+
ReleaseGuardedTransactionGroupWrite(pending);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Guard B for a save, judged on the database rather than the caches: a transaction group
|
|
216
|
+
* holding this and another guarded write that concerns the system user is refused; an update
|
|
217
|
+
* that re-points the row is checked as a removal of the pair it leaves; and an assignment of
|
|
218
|
+
* a role to the system user is refused when that role carries a stored `Deny`. A read that
|
|
219
|
+
* fails refuses the save.
|
|
220
|
+
*/
|
|
221
|
+
async systemUserSaveRejection() {
|
|
222
|
+
const priorUserID = this.priorValue('UserID', this.UserID);
|
|
223
|
+
const concernsSystemUser = IsSystemUserID(this.UserID) || priorUserID === undefined || IsSystemUserID(priorUserID);
|
|
224
|
+
const groupRefusal = this.groupRefusal(concernsSystemUser);
|
|
225
|
+
if (groupRefusal || !concernsSystemUser) {
|
|
226
|
+
return groupRefusal;
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
const removal = this.IsSaved ? await this.vacatedPairRemovalReason() : null;
|
|
230
|
+
return removal ?? (await this.storedAssignmentRejectionReason());
|
|
231
|
+
}
|
|
232
|
+
catch (e) {
|
|
233
|
+
return MJUserRoleEntityServer_1.unverifiableMessage(e);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Why assigning this row's role to the system user is refused on the rules as stored now, or
|
|
238
|
+
* null. Only a create or a re-point assigns; an update that keeps the pair assigns nothing new.
|
|
239
|
+
*/
|
|
240
|
+
async storedAssignmentRejectionReason() {
|
|
241
|
+
if (!IsSystemUserID(this.UserID) || !this.RoleID || (this.IsSaved && !this.isRepoint())) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
const fieldIDs = await StoredRestrictingFieldIDsForRole(this.RunViewProviderToUse, this.RoleID);
|
|
245
|
+
const entities = MJUserRoleEntityServer_1.entityNamesForFieldIDs(fieldIDs, this.ProviderToUse);
|
|
246
|
+
return entities.length > 0 ? MJUserRoleEntityServer_1.assignmentRejectionMessage(entities) : null;
|
|
247
|
+
}
|
|
248
|
+
/** Whether this update moves the row to a different (user, role) pair. Unknown prior values count as a move. */
|
|
249
|
+
isRepoint() {
|
|
250
|
+
const priorUserID = this.priorValue('UserID', this.UserID);
|
|
251
|
+
const priorRoleID = this.priorValue('RoleID', this.RoleID);
|
|
252
|
+
if (priorUserID === undefined || priorRoleID === undefined) {
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
return !UUIDsEqual(priorUserID, this.UserID) || !UUIDsEqual(priorRoleID, this.RoleID);
|
|
256
|
+
}
|
|
257
|
+
/** Names of the entities owning the given fields, from loaded metadata, each once. */
|
|
258
|
+
static entityNamesForFieldIDs(fieldIDs, provider) {
|
|
259
|
+
const md = provider ?? new Metadata();
|
|
260
|
+
const ids = new UUIDSet(fieldIDs);
|
|
261
|
+
const names = new Set();
|
|
262
|
+
for (const entity of md.Entities) {
|
|
263
|
+
if (entity.Fields.some((f) => ids.Has(f.ID))) {
|
|
264
|
+
names.add(entity.Name);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return [...names];
|
|
268
|
+
}
|
|
269
|
+
/** The refusal when the system user's field access cannot be checked because a read failed. */
|
|
270
|
+
static unverifiableMessage(error) {
|
|
271
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
272
|
+
return `Could not check this change against the MJ system user's field access, so it was not saved. ${detail}`;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Why re-pointing this assignment away from its stored (user, role) pair would cost the MJ
|
|
276
|
+
* system user field access, or null when it would not.
|
|
277
|
+
*
|
|
278
|
+
* Evaluated as a removal of the OLD pair with nothing added in its place. When `RoleID` moves
|
|
279
|
+
* between two roles on the system user that is conservative — the incoming role might hold the
|
|
280
|
+
* very `Allow` the outgoing one is taking away — but assigning the new role first and then
|
|
281
|
+
* deleting the old one reaches the same state through checks that can each see the whole
|
|
282
|
+
* picture.
|
|
283
|
+
*
|
|
284
|
+
* A re-pointed column whose prior value cannot be established fails CLOSED while there is a
|
|
285
|
+
* system user to protect: the vacated pair might be one of its roles.
|
|
286
|
+
*/
|
|
287
|
+
async vacatedPairRemovalReason() {
|
|
288
|
+
if (!this.isRepoint()) {
|
|
289
|
+
return null; // not a re-point — at most a change of casing
|
|
290
|
+
}
|
|
291
|
+
return this.storedPairRemovalReason();
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Why removing this row's STORED (user, role) pair would cost the system user field access,
|
|
295
|
+
* or null. Shared by the delete path and the re-point path, which take the same pair apart.
|
|
296
|
+
*/
|
|
297
|
+
async storedPairRemovalReason() {
|
|
298
|
+
const priorUserID = this.priorValue('UserID', this.UserID);
|
|
299
|
+
const priorRoleID = this.priorValue('RoleID', this.RoleID);
|
|
300
|
+
if (priorUserID === undefined || priorRoleID === undefined) {
|
|
301
|
+
return UserCache.Instance?.GetSystemUser?.() ? UNDETERMINED_PRIOR_ASSIGNMENT_MESSAGE : null;
|
|
302
|
+
}
|
|
303
|
+
return this.systemUserRoleRemovalReason(priorUserID, priorRoleID);
|
|
304
|
+
}
|
|
305
|
+
/** A column's stored value; undefined when it is dirty and its old value is not a usable ID. */
|
|
306
|
+
priorValue(fieldName, current) {
|
|
307
|
+
const field = this.GetFieldByName(fieldName);
|
|
308
|
+
if (!field?.Dirty) {
|
|
309
|
+
return current;
|
|
310
|
+
}
|
|
311
|
+
const old = field.OldValue;
|
|
312
|
+
return typeof old === 'string' && old.length > 0 ? old : undefined;
|
|
172
313
|
}
|
|
173
314
|
/**
|
|
174
315
|
* Enforces both guards on the delete path.
|
|
@@ -197,11 +338,47 @@ let MJUserRoleEntityServer = MJUserRoleEntityServer_1 = class MJUserRoleEntitySe
|
|
|
197
338
|
return this.refuse('delete', 'You may only revoke a role that you hold yourself. Revoking a role you do not hold would let you ' +
|
|
198
339
|
'strip authority you were never granted. Ask an Owner to make this change.');
|
|
199
340
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
341
|
+
// Judged against the STORED pair: a delete removes the row by ID, whatever unsaved edits
|
|
342
|
+
// this object carries.
|
|
343
|
+
let deleted = false;
|
|
344
|
+
try {
|
|
345
|
+
const rejection = await this.systemUserDeleteRejection();
|
|
346
|
+
if (rejection) {
|
|
347
|
+
return this.refuse('delete', rejection);
|
|
348
|
+
}
|
|
349
|
+
deleted = await super.Delete(options);
|
|
350
|
+
return deleted;
|
|
351
|
+
}
|
|
352
|
+
finally {
|
|
353
|
+
this.settleGroupWrite(deleted);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Guard B's transaction-group rule for this write. When it passes, the write's place in the
|
|
358
|
+
* group is reserved in the same step, so a second guarded write in flight at once sees it.
|
|
359
|
+
*/
|
|
360
|
+
groupRefusal(concernsSystemUser) {
|
|
361
|
+
this.pendingGroupWrite = null;
|
|
362
|
+
const refusal = GuardedTransactionGroupRefusal(this.TransactionGroup, concernsSystemUser);
|
|
363
|
+
if (!refusal) {
|
|
364
|
+
this.pendingGroupWrite = ReserveGuardedTransactionGroupWrite(this.TransactionGroup, concernsSystemUser);
|
|
365
|
+
}
|
|
366
|
+
return refusal;
|
|
367
|
+
}
|
|
368
|
+
/** Guard B for a delete: the transaction-group rule, then the removal check on stored state. */
|
|
369
|
+
async systemUserDeleteRejection() {
|
|
370
|
+
const priorUserID = this.priorValue('UserID', this.UserID);
|
|
371
|
+
const concernsSystemUser = priorUserID === undefined || IsSystemUserID(priorUserID);
|
|
372
|
+
const groupRefusal = this.groupRefusal(concernsSystemUser);
|
|
373
|
+
if (groupRefusal) {
|
|
374
|
+
return groupRefusal;
|
|
375
|
+
}
|
|
376
|
+
try {
|
|
377
|
+
return await this.storedPairRemovalReason();
|
|
378
|
+
}
|
|
379
|
+
catch (e) {
|
|
380
|
+
return MJUserRoleEntityServer_1.unverifiableMessage(e);
|
|
203
381
|
}
|
|
204
|
-
return super.Delete(options);
|
|
205
382
|
}
|
|
206
383
|
/**
|
|
207
384
|
* Invariants 1 and 2's forward half — the role being assigned must be one the caller holds.
|
|
@@ -285,16 +462,20 @@ let MJUserRoleEntityServer = MJUserRoleEntityServer_1 = class MJUserRoleEntitySe
|
|
|
285
462
|
return caller.Type?.trim().toLowerCase() === 'owner';
|
|
286
463
|
}
|
|
287
464
|
/**
|
|
288
|
-
* Why
|
|
289
|
-
* Only ever rejects for the system user; every other user is unaffected.
|
|
465
|
+
* Why taking `roleID` off `userID` would cost the system user field access, or null when it
|
|
466
|
+
* would not. Only ever rejects for the system user; every other user is unaffected.
|
|
467
|
+
*
|
|
468
|
+
* Parameterized because the delete path and the re-point path both ask about the pair as
|
|
469
|
+
* STORED, which on a re-point is only available from the dirty fields' old values.
|
|
290
470
|
*/
|
|
291
|
-
systemUserRoleRemovalReason() {
|
|
292
|
-
|
|
293
|
-
if (!systemUser || !this.UserID || !this.RoleID || !UUIDsEqual(systemUser.ID, this.UserID)) {
|
|
471
|
+
async systemUserRoleRemovalReason(userID, roleID) {
|
|
472
|
+
if (!roleID || !IsSystemUserID(userID)) {
|
|
294
473
|
return null; // not the system user — nothing to guard
|
|
295
474
|
}
|
|
475
|
+
// The role set and the rules as stored now: the caches may not yet show a role assigned or
|
|
476
|
+
// removed, or a rule edited, a moment ago.
|
|
296
477
|
const provider = this.ProviderToUse;
|
|
297
|
-
const lost =
|
|
478
|
+
const lost = await StoredRoleRemovalViolations(this.RunViewProviderToUse, provider, roleID);
|
|
298
479
|
if (lost.length === 0) {
|
|
299
480
|
return null;
|
|
300
481
|
}
|
|
@@ -323,6 +504,10 @@ let MJUserRoleEntityServer = MJUserRoleEntityServer_1 = class MJUserRoleEntitySe
|
|
|
323
504
|
if (restricted.length === 0) {
|
|
324
505
|
return null;
|
|
325
506
|
}
|
|
507
|
+
return MJUserRoleEntityServer_1.assignmentRejectionMessage(restricted);
|
|
508
|
+
}
|
|
509
|
+
/** The refusal for assigning the system user a role that denies a field on the named entities. */
|
|
510
|
+
static assignmentRejectionMessage(restricted) {
|
|
326
511
|
const shown = restricted.slice(0, 3).join(', ');
|
|
327
512
|
const more = restricted.length > 3 ? `, and ${restricted.length - 3} more` : '';
|
|
328
513
|
return (`This role denies access to at least one field (on ${shown}${more}), so it cannot be assigned to the MJ system user. ` +
|
|
@@ -332,7 +517,8 @@ let MJUserRoleEntityServer = MJUserRoleEntityServer_1 = class MJUserRoleEntitySe
|
|
|
332
517
|
}
|
|
333
518
|
/**
|
|
334
519
|
* Names of entities where this role carries at least one RESTRICTING field rule — a `Deny`
|
|
335
|
-
* on any verb
|
|
520
|
+
* on any verb, under any spelling (the column's collation stores `'deny'` too, and enforcement
|
|
521
|
+
* honors it). Walks cached metadata only — no database access. Runs only when the system
|
|
336
522
|
* user is the save target, which is rare.
|
|
337
523
|
*
|
|
338
524
|
* Grants and neutrals are ignored, and must be: the system user holds the standard roles
|
|
@@ -354,7 +540,7 @@ let MJUserRoleEntityServer = MJUserRoleEntityServer_1 = class MJUserRoleEntitySe
|
|
|
354
540
|
const names = [];
|
|
355
541
|
for (const entity of md.Entities) {
|
|
356
542
|
const hit = entity.Fields.some(f => f.HasFieldPermissions &&
|
|
357
|
-
f.FieldPermissions.some(fp => UUIDsEqual(fp.RoleID, roleID) &&
|
|
543
|
+
f.FieldPermissions.some(fp => UUIDsEqual(fp.RoleID, roleID) && IsRestrictingFieldRuleAnyCase(fp)));
|
|
358
544
|
if (hit) {
|
|
359
545
|
names.push(entity.Name);
|
|
360
546
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJUserRoleEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJUserRoleEntityServer.server.ts"],"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C;;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACtC,QAAQ;AACZ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityInfo, IMetadataProvider, ValidationResult } from "@memberjunction/core";
|
|
1
|
+
import { EntityInfo, EntitySaveOptions, IMetadataProvider, ValidationResult } from "@memberjunction/core";
|
|
2
2
|
import { MJUserViewEntityExtended } from '@memberjunction/core-entities';
|
|
3
3
|
/**
|
|
4
4
|
* Template data passed to the Smart Filter Generation Nunjucks prompt.
|
|
@@ -12,13 +12,29 @@ interface SmartFilterTemplateData extends Record<string, unknown> {
|
|
|
12
12
|
listsSchema: string;
|
|
13
13
|
listsFields: string;
|
|
14
14
|
listDetailsFields: string;
|
|
15
|
+
alternateBaseViewName?: string;
|
|
16
|
+
alternateBaseViewDescription?: string;
|
|
15
17
|
}
|
|
16
18
|
export declare class MJUserViewEntityServer extends MJUserViewEntityExtended {
|
|
17
19
|
/**
|
|
18
20
|
* This property is hard-coded to true in this class because we DO support smart filters in this class. If you want to disable smart filters for a specific view you can override this property in your subclass and set it to false.
|
|
19
21
|
*/
|
|
20
22
|
protected get SmartFilterImplemented(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Applies the approval rules (see `ApplyApprovalRulesAsync`). The base save regenerates the
|
|
25
|
+
* WhereClause before it writes, so an approving save stamps the fingerprint after the write,
|
|
26
|
+
* from the definition as stored, with one more write.
|
|
27
|
+
*/
|
|
28
|
+
Save(options?: EntitySaveOptions): Promise<boolean>;
|
|
21
29
|
Validate(): ValidationResult;
|
|
30
|
+
/**
|
|
31
|
+
* Validates that a pinned `DisplayState.alternateBaseView` (if newly set or changed)
|
|
32
|
+
* corresponds to a registered, usable alternate base view on the view's target entity.
|
|
33
|
+
* Existing saved views whose pinned alternate base view did not change are allowed to save
|
|
34
|
+
* other edits (e.g. renaming or clearing the pin after an admin disabled the alternate view).
|
|
35
|
+
*/
|
|
36
|
+
private validatePinnedAlternateBaseView;
|
|
37
|
+
private hasAlternateBaseViewChanged;
|
|
22
38
|
/**
|
|
23
39
|
* SECURITY: screens the SQL this view stores with the clause screen the RunView API applies to
|
|
24
40
|
* client filters — its WhereClause (set directly, compiled from FilterState, or made by a Smart
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJUserViewEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJUserViewEntityServer.server.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,
|
|
1
|
+
{"version":3,"file":"MJUserViewEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJUserViewEntityServer.server.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAE,iBAAiB,EAAsD,iBAAiB,EAAsD,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9N,OAAO,EAAmC,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAgBzG;;GAEG;AACH,UAAU,uBAAwB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACzC;AAED,qBACa,sBAAuB,SAAQ,wBAAwB;IAChE;;OAEG;IACH,cAAuB,sBAAsB,IAAI,OAAO,CAEvD;IAED;;;;OAIG;IACmB,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAwBzD,QAAQ,IAAI,gBAAgB;IAS5C;;;;;OAKG;IACH,OAAO,CAAC,+BAA+B;IAmCvC,OAAO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