@memberjunction/core-entities 6.1.0-edge.1 → 6.1.0-edge.2
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/MJDashboardEntityExtended.d.ts.map +1 -1
- package/dist/custom/MJDashboardEntityExtended.js +16 -2
- package/dist/custom/MJDashboardEntityExtended.js.map +1 -1
- package/dist/generated/entity_subclasses.d.ts +824 -87
- package/dist/generated/entity_subclasses.d.ts.map +1 -1
- package/dist/generated/entity_subclasses.js +477 -132
- package/dist/generated/entity_subclasses.js.map +1 -1
- package/dist/generated/remote_operations.d.ts +196 -5
- package/dist/generated/remote_operations.d.ts.map +1 -1
- package/dist/generated/remote_operations.js +18 -0
- package/dist/generated/remote_operations.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJDashboardEntityExtended.d.ts","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityExtended.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAA+B,MAAM,sBAAsB,CAAC;AACpG,OAAO,
|
|
1
|
+
{"version":3,"file":"MJDashboardEntityExtended.d.ts","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityExtended.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAA+B,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAkD,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,qBACa,yBAA0B,SAAQ,iBAAiB;IACrD,SAAS,IAAI,OAAO;IA4B3B;;;;OAIG;IACa,QAAQ,IAAI,gBAAgB;IAkD5C;;;OAGG;IACmB,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAoBhF"}
|
|
@@ -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 { BaseEntity, LogError } from "@memberjunction/core";
|
|
8
|
-
import { RegisterClass, ValidationErrorInfo } from "@memberjunction/global";
|
|
8
|
+
import { RegisterClass, UUIDsEqual, ValidationErrorInfo } from "@memberjunction/global";
|
|
9
9
|
import { MJDashboardEntity } from "../generated/entity_subclasses.js";
|
|
10
10
|
import { DashboardEngine } from "../engines/dashboards.js";
|
|
11
11
|
let MJDashboardEntityExtended = class MJDashboardEntityExtended extends MJDashboardEntity {
|
|
@@ -52,7 +52,21 @@ let MJDashboardEntityExtended = class MJDashboardEntityExtended extends MJDashbo
|
|
|
52
52
|
// For existing records (not new), check edit permission
|
|
53
53
|
if (this.IsSaved) {
|
|
54
54
|
const permissions = DashboardEngine.Instance.GetDashboardPermissions(this.ID, currentUser.ID);
|
|
55
|
-
|
|
55
|
+
// An unloaded engine is not a permission decision. GetDashboardPermissions resolves
|
|
56
|
+
// against `_dashboards`, and a dashboard it cannot find returns "no permissions" — which
|
|
57
|
+
// is indistinguishable from a genuine denial. In a process that never configures the
|
|
58
|
+
// engine (a CLI task, where the 14 engines are deferred to first use), that array is
|
|
59
|
+
// empty, so EVERY dashboard save is refused, including the owner's own.
|
|
60
|
+
//
|
|
61
|
+
// Ownership does not need the cache to be answered: the row carries UserID. Falling back
|
|
62
|
+
// to it keeps the owner able to save while leaving every real denial intact — a loaded
|
|
63
|
+
// engine still decides, and a non-owner is still refused either way.
|
|
64
|
+
//
|
|
65
|
+
// Found by `mj sync push` on PostgreSQL, where this record is dirty and therefore
|
|
66
|
+
// reaches Validate(); on SQL Server the same record is unchanged, so Save() short-
|
|
67
|
+
// circuits and the defect stays hidden.
|
|
68
|
+
const ownsRecord = !DashboardEngine.Instance.Loaded && UUIDsEqual(this.UserID, currentUser.ID);
|
|
69
|
+
if (!permissions.CanEdit && !ownsRecord) {
|
|
56
70
|
result.Success = false;
|
|
57
71
|
result.Errors.push(new ValidationErrorInfo('Permission', 'You do not have permission to edit this dashboard', this.ID));
|
|
58
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJDashboardEntityExtended.js","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityExtended.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAA0C,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAoB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"MJDashboardEntityExtended.js","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityExtended.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAA0C,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAoB,MAAM,wBAAwB,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGjD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,iBAAiB;IACrD,SAAS;QACZ,IAAG,CAAC;YACA,KAAK,CAAC,SAAS,EAAE,CAAC;YAClB,MAAM,oBAAoB,GAAG;gBACzB,OAAO,EAAE,CAAC;gBACV,SAAS,EAAE,GAAG;gBACd,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,IAAI;gBACjB,KAAK,EAAE,EAAE;aACZ,CAAA;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;YACxD,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;YAExC,MAAM,EAAE,GAAG,IAAI,CAAC,aAA6C,CAAC;YAC9D,IAAG,EAAE,CAAC,WAAW,EAAC,CAAC;gBACf,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAA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