@memberjunction/core-entities-server 6.1.0-edge.4 → 6.1.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/MJAIPromptRunEntityServer.server.d.ts +76 -0
- package/dist/custom/MJAIPromptRunEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIPromptRunEntityServer.server.js +164 -28
- package/dist/custom/MJAIPromptRunEntityServer.server.js.map +1 -1
- package/dist/custom/MJActionEntityServer.server.d.ts +2 -2
- package/dist/custom/MJActionEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJActionEntityServer.server.js +8 -6
- package/dist/custom/MJActionEntityServer.server.js.map +1 -1
- package/dist/custom/MJApplicationEntityServer.server.d.ts +2 -2
- package/dist/custom/MJApplicationEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJApplicationEntityServer.server.js +4 -4
- package/dist/custom/MJApplicationEntityServer.server.js.map +1 -1
- package/dist/custom/MJConversationDetailEntityServer.server.d.ts +14 -2
- package/dist/custom/MJConversationDetailEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJConversationDetailEntityServer.server.js +14 -2
- package/dist/custom/MJConversationDetailEntityServer.server.js.map +1 -1
- package/dist/custom/MJRemoteOperationEntityServer.server.d.ts +2 -2
- package/dist/custom/MJRemoteOperationEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJRemoteOperationEntityServer.server.js +6 -4
- package/dist/custom/MJRemoteOperationEntityServer.server.js.map +1 -1
- package/dist/custom/MJRoleEntityServer.server.d.ts +78 -0
- package/dist/custom/MJRoleEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJRoleEntityServer.server.js +131 -0
- package/dist/custom/MJRoleEntityServer.server.js.map +1 -0
- package/dist/custom/MJUserEntityServer.server.d.ts +243 -0
- package/dist/custom/MJUserEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJUserEntityServer.server.js +335 -0
- package/dist/custom/MJUserEntityServer.server.js.map +1 -0
- package/dist/custom/MJUserRoleEntityServer.server.d.ts +146 -0
- package/dist/custom/MJUserRoleEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJUserRoleEntityServer.server.js +216 -0
- package/dist/custom/MJUserRoleEntityServer.server.js.map +1 -0
- package/dist/custom/MJUserViewEntityServer.server.d.ts +12 -1
- package/dist/custom/MJUserViewEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserViewEntityServer.server.js +33 -1
- package/dist/custom/MJUserViewEntityServer.server.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +28 -28
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { BaseEntity, BaseEntityResult, ValidationErrorInfo, ValidationErrorType } from '@memberjunction/core';
|
|
8
|
+
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
|
|
9
|
+
import { MJUserRoleEntity } from '@memberjunction/core-entities';
|
|
10
|
+
/**
|
|
11
|
+
* Server-side `MJ: User Roles` entity enforcing MJ's role-elevation invariant (issue #4282).
|
|
12
|
+
*
|
|
13
|
+
* WHY THIS EXISTS AT ALL. Issue #4260 (`MJUserEntityServer`) closed the `User.Type` route to
|
|
14
|
+
* elevated capability. Role assignment is the platform's OTHER authority mechanism and was
|
|
15
|
+
* unguarded: verified against a live database, the `Developer` and `Integration` roles hold
|
|
16
|
+
* unfiltered `CanCreate`/`CanUpdate`/`CanDelete` on `MJ: User Roles`, `AllowCreateAPI` /
|
|
17
|
+
* `AllowUpdateAPI` / `AllowDeleteAPI` are all true on the entity, and no server-side subclass
|
|
18
|
+
* existed — `ClassFactory` resolved the generated `MJUserRoleEntity`, whose `Validate()` knows
|
|
19
|
+
* nothing about who is calling. Reproduced end to end before this class was written: a caller whose
|
|
20
|
+
* `Type` is `'User'`, holding only `Developer` and `UI`, inserted a row granting itself
|
|
21
|
+
* `Integration`; `Validate()` returned `Success=true` and `Save()` returned `true`.
|
|
22
|
+
*
|
|
23
|
+
* THE INVARIANT: **a non-Owner may only grant, move or revoke a role they themselves hold.**
|
|
24
|
+
*
|
|
25
|
+
* Why that rule and not a stricter one. Unlike `User.Type` — two values, no legitimate non-Owner
|
|
26
|
+
* write — role assignment has real non-Owner use cases the platform ships with: delegated
|
|
27
|
+
* administration, IdP/group sync, onboarding automation. The subset rule is the weakest rule that
|
|
28
|
+
* still closes elevation completely, because it is a CEILING: whatever a non-Owner does through
|
|
29
|
+
* this entity, the authority they can hand out is authority they already had, so no sequence of
|
|
30
|
+
* calls lets any caller exceed their own grant. Issue #4282 also floated adding "and may not grant
|
|
31
|
+
* a role that confers write access to `MJ: Roles`/`MJ: User Roles`". That was considered and
|
|
32
|
+
* declined: it does not close any elevation the subset rule leaves open (granting a peer a role you
|
|
33
|
+
* hold is delegation, not escape), it breaks the peer-onboarding case above, and it would require
|
|
34
|
+
* this guard to read `EntityInfo.Permissions` — trading the purity below for protection that
|
|
35
|
+
* `MJ: Entity Permissions` (which carries the SAME unfiltered `Developer`/`Integration` grant, and
|
|
36
|
+
* is a separate, still-open route) would undercut anyway.
|
|
37
|
+
*
|
|
38
|
+
* WHY HERE RATHER THAN IN A RESOLVER, and why `Save()`/`Delete()` are overridden alongside
|
|
39
|
+
* `Validate()`: identical reasoning to `MJUserEntityServer`, and see that file for the full
|
|
40
|
+
* argument. In short — `Validate()` runs inside `BaseEntity.Save()`, so the rule holds on every
|
|
41
|
+
* write path (GraphQL resolvers, Remote Operations, the Create/Update/Delete Record actions,
|
|
42
|
+
* metadata sync, one-off scripts) and for any role a deployment invents; but `BaseEntity.Save()`
|
|
43
|
+
* force-passes validation WITHOUT calling `Validate()` under `EntitySaveOptions.ReplayOnly`
|
|
44
|
+
* (`baseEntity.ts:3725`) while still performing the write, and `Delete()` never consults
|
|
45
|
+
* `Validate()` at all. Overriding all three is what makes "every write path" literal.
|
|
46
|
+
*
|
|
47
|
+
* THE INVARIANTS, for a caller whose `Type` is not `'Owner'`:
|
|
48
|
+
*
|
|
49
|
+
* 1. **Create** — `RoleID` must name a role the caller holds. This is the #4282 escalation
|
|
50
|
+
* itself: the self-grant of an unheld role.
|
|
51
|
+
* 2. **Update** — the NEW `RoleID` must be held (invariant 1, reached through UPDATE instead of
|
|
52
|
+
* INSERT), and so must the PRE-SAVE `RoleID`. The second half is not redundant: moving an
|
|
53
|
+
* existing grant off a role you do not hold is a revocation you were not entitled to make,
|
|
54
|
+
* and without it a non-Owner could strip an Owner of any role by repointing the row.
|
|
55
|
+
* `UserID` is deliberately NOT frozen — moving a grant between users stays within the
|
|
56
|
+
* caller's ceiling, which is the whole point of the rule.
|
|
57
|
+
* 3. **Delete** — the row's `RoleID` must be held by the caller, for the same reason as the
|
|
58
|
+
* pre-save half of invariant 2. Revocation is bounded by the same ceiling as granting.
|
|
59
|
+
* 4. **A `ReplayOnly` save is refused outright**, because `ReplayOnly` is the one option that
|
|
60
|
+
* skips `Validate()` and therefore invariants 1-2. Refusing rather than re-running them keeps
|
|
61
|
+
* the decision in ONE place; `ReplayOnly` is a replication facility for trusted sync paths and
|
|
62
|
+
* a non-Owner has no legitimate reason to replay writes onto the role-assignment table.
|
|
63
|
+
*
|
|
64
|
+
* A caller holding NO roles can therefore grant nothing — correct, and it is also why this guard
|
|
65
|
+
* needs no special case for an unpopulated `UserInfo.UserRoles`: the subset test fails closed on
|
|
66
|
+
* an empty list on its own. (Server-side that list is populated — `MJServer`'s `context.ts` resolves
|
|
67
|
+
* the request principal from `UserCache` precisely "to ensure UserRoles is properly populated", and
|
|
68
|
+
* `CloneUserForSessionContext` carries it onto the per-session clone.)
|
|
69
|
+
*
|
|
70
|
+
* NOT COVERED, deliberately: a magic-link session's SYNTHESIZED roles (`context.ts`
|
|
71
|
+
* `buildMagicLinkSessionUser`) count as roles held, so a scope-limited principal is measured by the
|
|
72
|
+
* same rule as any other caller. Narrowing scope-limited principals further is a magic-link concern,
|
|
73
|
+
* not a role-elevation one — `IsScopeLimitedPrincipal` lives in MJServer, which this package cannot
|
|
74
|
+
* import, and duplicating its predicate here would put one decision in two places. Such a session
|
|
75
|
+
* still needs `CanCreate` on this entity to reach the guard at all, which the `Magic Link Baseline`
|
|
76
|
+
* role does not grant.
|
|
77
|
+
*
|
|
78
|
+
* Owner-type callers are exempt from all four, so admin role management, and the
|
|
79
|
+
* `SyncRolesAndUsers` / `SyncUsers` mutations (both `@RequireSystemUser()`, whose `getSystemUser()`
|
|
80
|
+
* resolves the seeded `Type='Owner'` system user), are unaffected on a default install. A
|
|
81
|
+
* deployment whose system user is NOT an Owner will see those sync paths fail closed — loudly,
|
|
82
|
+
* at the save — exactly as #4260 documented for `MJ: Users`.
|
|
83
|
+
*
|
|
84
|
+
* Pure: reads only this record's own field state and the caller's cached roles. No `RunView`, no
|
|
85
|
+
* provider, no engine, no I/O — so it costs nothing per save/delete and is unit-testable without a
|
|
86
|
+
* database.
|
|
87
|
+
*/
|
|
88
|
+
let MJUserRoleEntityServer = class MJUserRoleEntityServer extends MJUserRoleEntity {
|
|
89
|
+
Validate() {
|
|
90
|
+
const result = super.Validate();
|
|
91
|
+
if (!this.callerIsOwner()) {
|
|
92
|
+
this.validateRoleHeld(result, this.RoleID, 'You may only assign a role that you hold yourself. Assigning a role you do not hold would ' +
|
|
93
|
+
'grant authority you were not given. Ask an Owner to make this assignment.');
|
|
94
|
+
if (this.IsSaved) {
|
|
95
|
+
this.validatePriorRoleHeld(result);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
result.Success = result.Success && result.Errors.length === 0;
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Refuses a `ReplayOnly` save by a non-Owner caller — invariant 4. `ReplayOnly` force-passes
|
|
103
|
+
* validation without calling `Validate()` (`baseEntity.ts:3725`) yet does not suppress the
|
|
104
|
+
* write, so without this override invariants 1-2 were one caller-supplied option away from off
|
|
105
|
+
* while invariant 3 stayed enforced (an override cannot be switched off). Mirrors
|
|
106
|
+
* `MJUserEntityServer.Save()`, including its reasoning for refusing rather than re-validating.
|
|
107
|
+
*/
|
|
108
|
+
async Save(options) {
|
|
109
|
+
if (options?.ReplayOnly && !this.callerIsOwner()) {
|
|
110
|
+
return this.refuse(this.IsSaved ? 'update' : 'create', 'Only an Owner may perform a ReplayOnly save on a user-role assignment. ReplayOnly bypasses ' +
|
|
111
|
+
'validation, which is where this entity\'s role-elevation invariants are enforced.');
|
|
112
|
+
}
|
|
113
|
+
return super.Save(options);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Invariant 3 — a non-Owner may only revoke a role they hold themselves.
|
|
117
|
+
*
|
|
118
|
+
* Reports the refusal the way `MJUserEntityServer.Delete` does — a `BaseEntityResult` on the
|
|
119
|
+
* result history, so `LatestResult.CompleteMessage` carries the reason, `Delete()` returning
|
|
120
|
+
* `false` on a logical rejection rather than throwing (the CLAUDE.md Save/Delete error-handling
|
|
121
|
+
* contract). Note that `SyncRolesUsersResolver.SyncUserRoles` treats a `false` from this method
|
|
122
|
+
* as a hard error and throws, rolling its transaction back; that mutation runs as the system
|
|
123
|
+
* Owner, so it is exempt and never sees this refusal on a default install.
|
|
124
|
+
*/
|
|
125
|
+
async Delete(options) {
|
|
126
|
+
if (!this.callerIsOwner() && !this.callerHoldsRole(this.RoleID)) {
|
|
127
|
+
return this.refuse('delete', 'You may only revoke a role that you hold yourself. Revoking a role you do not hold would let you ' +
|
|
128
|
+
'strip authority you were never granted. Ask an Owner to make this change.');
|
|
129
|
+
}
|
|
130
|
+
return super.Delete(options);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Invariants 1 and 2's forward half — the role being assigned must be one the caller holds.
|
|
134
|
+
* Attributed to `RoleID` because that IS the field whose value is refused, so a form highlights
|
|
135
|
+
* the control the user must change.
|
|
136
|
+
*/
|
|
137
|
+
validateRoleHeld(result, roleId, message) {
|
|
138
|
+
if (this.callerHoldsRole(roleId)) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
result.Errors.push(new ValidationErrorInfo('RoleID', message, roleId ?? null, ValidationErrorType.Failure));
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Invariant 2's second half — the role this assignment granted BEFORE the edit must also be one
|
|
145
|
+
* the caller holds, compared against the pre-save value rather than whatever the in-memory
|
|
146
|
+
* object arrived holding. `MJ: User Roles` has `TrackRecordChanges=1`, which forces
|
|
147
|
+
* `ResolverBase.UpdateRecord` to genuinely load the row from the database before applying edits,
|
|
148
|
+
* so that pre-save value is the row's real prior state on every wire path — but that is an
|
|
149
|
+
* unrelated entity flag, not a guarantee this class should assume will always hold, so a
|
|
150
|
+
* pre-save value that cannot be established fails CLOSED with its own message rather than
|
|
151
|
+
* falling through to "you do not hold role null".
|
|
152
|
+
*/
|
|
153
|
+
validatePriorRoleHeld(result) {
|
|
154
|
+
const priorRoleId = this.GetFieldByName('RoleID')?.OldValue;
|
|
155
|
+
if (!priorRoleId) {
|
|
156
|
+
result.Errors.push(new ValidationErrorInfo('RoleID', 'Could not determine which role this assignment previously granted, so it cannot be checked ' +
|
|
157
|
+
'against your own roles. Refusing to save rather than risk changing a grant you were not ' +
|
|
158
|
+
'entitled to change.', priorRoleId ?? null, ValidationErrorType.Failure));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
this.validateRoleHeld(result, priorRoleId, 'You may only change an assignment of a role that you hold yourself. This assignment currently grants ' +
|
|
162
|
+
'a role you do not hold, so changing it would revoke authority you were never granted.');
|
|
163
|
+
}
|
|
164
|
+
/** Records a logical refusal on the result history so `LatestResult.CompleteMessage` carries the reason. */
|
|
165
|
+
refuse(type, message) {
|
|
166
|
+
const result = new BaseEntityResult();
|
|
167
|
+
result.Success = false;
|
|
168
|
+
result.Type = type;
|
|
169
|
+
result.Message = message;
|
|
170
|
+
result.StartedAt = new Date();
|
|
171
|
+
result.EndedAt = new Date();
|
|
172
|
+
this.RegisterResultHistoryEntry(result);
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* True when the caller's own role assignments include `roleId`.
|
|
177
|
+
*
|
|
178
|
+
* `UUIDsEqual` rather than `===` because role IDs reach this class from two different sources
|
|
179
|
+
* with two different casings — the cached `UserInfo.UserRoles` and the entity field the client
|
|
180
|
+
* sent (see `guides/UUID_COMPARISON_GUIDE.md`). A falsy `roleId`, or a caller with no roles,
|
|
181
|
+
* yields `false`: both are the fail-closed answer, and neither needs a branch of its own.
|
|
182
|
+
*/
|
|
183
|
+
callerHoldsRole(roleId) {
|
|
184
|
+
if (!roleId) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
const caller = this.ActiveUser;
|
|
188
|
+
return (caller?.UserRoles ?? []).some((userRole) => UUIDsEqual(userRole.RoleID, roleId));
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* True when the caller is an Owner (or when there is no caller to evaluate — the guard has
|
|
192
|
+
* nothing to compare against). `Type` is an `NCHAR` column, so it arrives space-padded; casing
|
|
193
|
+
* is normalized for the same reason `MJServer`'s `principals.ts` does.
|
|
194
|
+
*
|
|
195
|
+
* The "no caller ⇒ exempt" default has the same asymmetric reachability documented on
|
|
196
|
+
* `MJUserEntityServer.callerIsOwner()`: `BaseEntity.CheckPermissions` throws on a falsy
|
|
197
|
+
* `ActiveUser` BEFORE `Validate()` runs inside `Save()`, so the default is decorative there;
|
|
198
|
+
* in `Delete()` it is load-bearing, letting a caller-less delete proceed into `super.Delete()`
|
|
199
|
+
* where `CheckPermissions` is what actually refuses it.
|
|
200
|
+
*
|
|
201
|
+
* Reads `ActiveUser` rather than `ContextCurrentUser` directly so a per-request provider's
|
|
202
|
+
* `CurrentUser` is honored on multi-provider servers.
|
|
203
|
+
*/
|
|
204
|
+
callerIsOwner() {
|
|
205
|
+
const caller = this.ActiveUser;
|
|
206
|
+
if (!caller) {
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
return caller.Type?.trim().toLowerCase() === 'owner';
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
MJUserRoleEntityServer = __decorate([
|
|
213
|
+
RegisterClass(BaseEntity, 'MJ: User Roles')
|
|
214
|
+
], MJUserRoleEntityServer);
|
|
215
|
+
export { MJUserRoleEntityServer };
|
|
216
|
+
//# sourceMappingURL=MJUserRoleEntityServer.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJUserRoleEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJUserRoleEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAoD,mBAAmB,EAAE,mBAAmB,EAAoB,MAAM,sBAAsB,CAAC;AAClL,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,gBAAgB;IACxC,QAAQ;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,gBAAg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,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;;;;;;OAaG;IACK,aAAa;QACjB,MAAM,MAAM,GAAoB,IAAI,CAAC,UAAU,CAAC;QAChD,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;IACzD,CAAC;CACJ,CAAA;AArJY,sBAAsB;IADlC,aAAa,CAAC,UAAU,EAAE,gBAAgB,CAAC;GAC/B,sBAAsB,CAqJlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityInfo, IMetadataProvider } from "@memberjunction/core";
|
|
1
|
+
import { EntityInfo, 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.
|
|
@@ -18,6 +18,17 @@ export declare class MJUserViewEntityServer extends MJUserViewEntityExtended {
|
|
|
18
18
|
* 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
19
|
*/
|
|
20
20
|
protected get SmartFilterImplemented(): boolean;
|
|
21
|
+
Validate(): ValidationResult;
|
|
22
|
+
/**
|
|
23
|
+
* SECURITY gate: `CustomWhereClause = 1` tells the platform to fold the stored
|
|
24
|
+
* `WhereClause` into view SQL verbatim — it bypasses both the auto-generation in
|
|
25
|
+
* `UpdateWhereClause()` and the render-time `ValidateUserProvidedSQLClause` screen in
|
|
26
|
+
* the database provider (custom clauses may legitimately contain constructs that screen
|
|
27
|
+
* blocks). That makes the CustomWhereClause/WhereClause pair an arbitrary-SQL channel,
|
|
28
|
+
* so creating or modifying a view with `CustomWhereClause` enabled is restricted to
|
|
29
|
+
* admin (Owner-type) users. Ordinary views (CustomWhereClause off) are unaffected.
|
|
30
|
+
*/
|
|
31
|
+
private validateCustomWhereClauseAuthorization;
|
|
21
32
|
/**
|
|
22
33
|
* This method will use AI to return a valid WHERE clause based on the provided prompt. This is automatically called at the right time if the view has SmartFilterEnabled turned on and the SmartFilterPrompt is set. If you want
|
|
23
34
|
* to call this directly to get back a WHERE clause for other purposes you can call this method directly and provide both a prompt and the entity that the view is based on.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJUserViewEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJUserViewEntityServer.server.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAY,iBAAiB,
|
|
1
|
+
{"version":3,"file":"MJUserViewEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJUserViewEntityServer.server.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAY,iBAAiB,EAAsD,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjK,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAcxE;;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;CAC7B;AAED,qBACa,sBAAuB,SAAQ,wBAAwB;IAChE;;OAEG;IACH,cAAuB,sBAAsB,IAAI,OAAO,CAEvD;IAEe,QAAQ,IAAI,gBAAgB;IAO5C;;;;;;;;OAQG;IACH,OAAO,CAAC,sCAAsC;IAwB9C;;;;OAIG;IACU,8BAA8B,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAC,CAAC;IAkF5I;;;OAGG;IACH,SAAS,CAAC,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,uBAAuB;IAwC5E;;OAEG;IACH,SAAS,CAAC,4BAA4B,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM;CAoC1H"}
|
|
@@ -5,7 +5,7 @@ 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
|
import { RegisterClass, CleanAndParseJSON } from "@memberjunction/global";
|
|
8
|
-
import { BaseEntity, LogError } from "@memberjunction/core";
|
|
8
|
+
import { BaseEntity, LogError, ValidationErrorInfo, ValidationErrorType } from "@memberjunction/core";
|
|
9
9
|
import { MJUserViewEntityExtended } from '@memberjunction/core-entities';
|
|
10
10
|
import { AIPromptParams } from "@memberjunction/ai-core-plus";
|
|
11
11
|
import { AIEngine } from "@memberjunction/aiengine";
|
|
@@ -17,6 +17,38 @@ let MJUserViewEntityServer = class MJUserViewEntityServer extends MJUserViewEnti
|
|
|
17
17
|
get SmartFilterImplemented() {
|
|
18
18
|
return true;
|
|
19
19
|
}
|
|
20
|
+
Validate() {
|
|
21
|
+
const result = super.Validate();
|
|
22
|
+
this.validateCustomWhereClauseAuthorization(result);
|
|
23
|
+
result.Success = result.Success && result.Errors.length === 0;
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* SECURITY gate: `CustomWhereClause = 1` tells the platform to fold the stored
|
|
28
|
+
* `WhereClause` into view SQL verbatim — it bypasses both the auto-generation in
|
|
29
|
+
* `UpdateWhereClause()` and the render-time `ValidateUserProvidedSQLClause` screen in
|
|
30
|
+
* the database provider (custom clauses may legitimately contain constructs that screen
|
|
31
|
+
* blocks). That makes the CustomWhereClause/WhereClause pair an arbitrary-SQL channel,
|
|
32
|
+
* so creating or modifying a view with `CustomWhereClause` enabled is restricted to
|
|
33
|
+
* admin (Owner-type) users. Ordinary views (CustomWhereClause off) are unaffected.
|
|
34
|
+
*/
|
|
35
|
+
validateCustomWhereClauseAuthorization(result) {
|
|
36
|
+
const isCustom = !!this.CustomWhereClause; // truthy — the DB may hand back true or 1
|
|
37
|
+
if (!isCustom) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const customDirty = this.GetFieldByName('CustomWhereClause')?.Dirty === true;
|
|
41
|
+
const whereDirty = this.GetFieldByName('WhereClause')?.Dirty === true;
|
|
42
|
+
if (!customDirty && !whereDirty) {
|
|
43
|
+
// Neither sensitive field changed on this save — nothing new to authorize.
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const user = this.ContextCurrentUser
|
|
47
|
+
?? this.ProviderToUse.CurrentUser;
|
|
48
|
+
if (!user || user.Type?.trim().toLowerCase() !== 'owner') {
|
|
49
|
+
result.Errors.push(new ValidationErrorInfo('CustomWhereClause', 'Only an administrator (Owner-type user) may create or modify a view with CustomWhereClause enabled — the custom WhereClause is executed as raw SQL.', this.CustomWhereClause, ValidationErrorType.Failure));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
20
52
|
/**
|
|
21
53
|
* This method will use AI to return a valid WHERE clause based on the provided prompt. This is automatically called at the right time if the view has SmartFilterEnabled turned on and the SmartFilterPrompt is set. If you want
|
|
22
54
|
* to call this directly to get back a WHERE clause for other purposes you can call this method directly and provide both a prompt and the entity that the view is based on.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJUserViewEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJUserViewEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE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GED
|
@@ -35,6 +35,9 @@ export * from './custom/MJMaterializedResultEntityServer.server.js';
|
|
|
35
35
|
export * from './custom/MJAISkillPermissionEntityServer.server.js';
|
|
36
36
|
export * from './custom/MJAISkillEntityServer.server.js';
|
|
37
37
|
export * from './custom/MJMLTrainingPipelineEntityServer.server.js';
|
|
38
|
+
export * from './custom/MJUserEntityServer.server.js';
|
|
39
|
+
export * from './custom/MJRoleEntityServer.server.js';
|
|
40
|
+
export * from './custom/MJUserRoleEntityServer.server.js';
|
|
38
41
|
export * from './custom/MJUserRoutineEntityServer.server.js';
|
|
39
42
|
export * from './custom/MJUserRoutineRecipientEntityServer.server.js';
|
|
40
43
|
export * from './custom/MJAPIKeyScopeEntityServer.server.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AACzD,cAAc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2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AACzD,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAClE,cAAc,sDAAsD,CAAC;AACrE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,eAAe,CAAC;AAE9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,9 @@ export * from './custom/MJMaterializedResultEntityServer.server.js';
|
|
|
35
35
|
export * from './custom/MJAISkillPermissionEntityServer.server.js';
|
|
36
36
|
export * from './custom/MJAISkillEntityServer.server.js';
|
|
37
37
|
export * from './custom/MJMLTrainingPipelineEntityServer.server.js';
|
|
38
|
+
export * from './custom/MJUserEntityServer.server.js';
|
|
39
|
+
export * from './custom/MJRoleEntityServer.server.js';
|
|
40
|
+
export * from './custom/MJUserRoleEntityServer.server.js';
|
|
38
41
|
export * from './custom/MJUserRoutineEntityServer.server.js';
|
|
39
42
|
export * from './custom/MJUserRoutineRecipientEntityServer.server.js';
|
|
40
43
|
export * from './custom/MJAPIKeyScopeEntityServer.server.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AACzD,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,+DAA+D,CAAC;AAC9E,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Ac,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAClE,cAAc,sDAAsD,CAAC;AACrE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,eAAe,CAAC;AAE9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/core-entities-server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.1.0-edge.
|
|
4
|
+
"version": "6.1.0-edge.6",
|
|
5
5
|
"description": "Entity subclasses for the metadata layer of MemberJunction that are only used on server side applications like MJAPI, distributed as part of each release of MemberJunction",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -15,33 +15,33 @@
|
|
|
15
15
|
"typescript": "^5.9.3"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@memberjunction/actions-base": "6.1.0-edge.
|
|
19
|
-
"@memberjunction/ai": "6.1.0-edge.
|
|
20
|
-
"@memberjunction/ai-core-plus": "6.1.0-edge.
|
|
21
|
-
"@memberjunction/ai-engine-base": "6.1.0-edge.
|
|
22
|
-
"@memberjunction/ai-prompts": "6.1.0-edge.
|
|
23
|
-
"@memberjunction/ai-provider-bundle": "6.1.0-edge.
|
|
24
|
-
"@memberjunction/ai-vector-dupe": "6.1.0-edge.
|
|
25
|
-
"@memberjunction/ai-vectordb": "6.1.0-edge.
|
|
26
|
-
"@memberjunction/ai-vectors-memory": "6.1.0-edge.
|
|
27
|
-
"@memberjunction/aiengine": "6.1.0-edge.
|
|
28
|
-
"@memberjunction/core": "6.1.0-edge.
|
|
29
|
-
"@memberjunction/core-entities": "6.1.0-edge.
|
|
30
|
-
"@memberjunction/predictive-studio-core": "6.1.0-edge.
|
|
31
|
-
"@memberjunction/doc-utils": "6.1.0-edge.
|
|
32
|
-
"@memberjunction/generic-database-provider": "6.1.0-edge.
|
|
33
|
-
"@memberjunction/global": "6.1.0-edge.
|
|
34
|
-
"@memberjunction/integration-engine": "6.1.0-edge.
|
|
35
|
-
"@memberjunction/integration-pk-classifier": "6.1.0-edge.
|
|
36
|
-
"@memberjunction/scheduling-engine": "6.1.0-edge.
|
|
37
|
-
"@memberjunction/sql-converter": "6.1.0-edge.
|
|
38
|
-
"@memberjunction/sql-dialect": "6.1.0-edge.
|
|
39
|
-
"@memberjunction/sql-parser": "6.1.0-edge.
|
|
40
|
-
"@memberjunction/sqlserver-dataprovider": "6.1.0-edge.
|
|
41
|
-
"@memberjunction/tag-engine": "6.1.0-edge.
|
|
42
|
-
"@memberjunction/communication-engine": "6.1.0-edge.
|
|
43
|
-
"@memberjunction/communication-types": "6.1.0-edge.
|
|
44
|
-
"@memberjunction/templates": "6.1.0-edge.
|
|
18
|
+
"@memberjunction/actions-base": "6.1.0-edge.6",
|
|
19
|
+
"@memberjunction/ai": "6.1.0-edge.6",
|
|
20
|
+
"@memberjunction/ai-core-plus": "6.1.0-edge.6",
|
|
21
|
+
"@memberjunction/ai-engine-base": "6.1.0-edge.6",
|
|
22
|
+
"@memberjunction/ai-prompts": "6.1.0-edge.6",
|
|
23
|
+
"@memberjunction/ai-provider-bundle": "6.1.0-edge.6",
|
|
24
|
+
"@memberjunction/ai-vector-dupe": "6.1.0-edge.6",
|
|
25
|
+
"@memberjunction/ai-vectordb": "6.1.0-edge.6",
|
|
26
|
+
"@memberjunction/ai-vectors-memory": "6.1.0-edge.6",
|
|
27
|
+
"@memberjunction/aiengine": "6.1.0-edge.6",
|
|
28
|
+
"@memberjunction/core": "6.1.0-edge.6",
|
|
29
|
+
"@memberjunction/core-entities": "6.1.0-edge.6",
|
|
30
|
+
"@memberjunction/predictive-studio-core": "6.1.0-edge.6",
|
|
31
|
+
"@memberjunction/doc-utils": "6.1.0-edge.6",
|
|
32
|
+
"@memberjunction/generic-database-provider": "6.1.0-edge.6",
|
|
33
|
+
"@memberjunction/global": "6.1.0-edge.6",
|
|
34
|
+
"@memberjunction/integration-engine": "6.1.0-edge.6",
|
|
35
|
+
"@memberjunction/integration-pk-classifier": "6.1.0-edge.6",
|
|
36
|
+
"@memberjunction/scheduling-engine": "6.1.0-edge.6",
|
|
37
|
+
"@memberjunction/sql-converter": "6.1.0-edge.6",
|
|
38
|
+
"@memberjunction/sql-dialect": "6.1.0-edge.6",
|
|
39
|
+
"@memberjunction/sql-parser": "6.1.0-edge.6",
|
|
40
|
+
"@memberjunction/sqlserver-dataprovider": "6.1.0-edge.6",
|
|
41
|
+
"@memberjunction/tag-engine": "6.1.0-edge.6",
|
|
42
|
+
"@memberjunction/communication-engine": "6.1.0-edge.6",
|
|
43
|
+
"@memberjunction/communication-types": "6.1.0-edge.6",
|
|
44
|
+
"@memberjunction/templates": "6.1.0-edge.6",
|
|
45
45
|
"nunjucks": "3.2.4",
|
|
46
46
|
"rxjs": "~7.8.1",
|
|
47
47
|
"zod": "^3.25.0"
|