@azrico/webobject 1.4.4 → 1.4.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.
|
@@ -45,6 +45,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
45
45
|
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _isValidSR);
|
|
46
46
|
_defineProperty(_assertThisInitialized(_this), "meta_data", void 0);
|
|
47
47
|
_defineProperty(_assertThisInitialized(_this), "_id", "");
|
|
48
|
+
_defineProperty(_assertThisInitialized(_this), "_creator", void 0);
|
|
48
49
|
_defineProperty(_assertThisInitialized(_this), "_created_date", "");
|
|
49
50
|
_defineProperty(_assertThisInitialized(_this), "get_webtype", function () {
|
|
50
51
|
return _this.__web_type || _this.get_webpath();
|
|
@@ -11,6 +11,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
11
11
|
static readonly __cache_name?: string;
|
|
12
12
|
static readonly __unchangeables?: string[];
|
|
13
13
|
static readonly __changeables?: string[];
|
|
14
|
+
static readonly __protectedProperties?: string[];
|
|
14
15
|
static readonly __extraProperties?: string[];
|
|
15
16
|
static readonly __use_delta: boolean;
|
|
16
17
|
_static(): Function;
|
|
@@ -94,7 +95,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
94
95
|
* @param useExtraProps
|
|
95
96
|
* @returns
|
|
96
97
|
*/
|
|
97
|
-
static canChangeKey(object: SimpleObject, key: string, useExtraProps: boolean):
|
|
98
|
+
static canChangeKey(object: SimpleObject, key: string, useExtraProps: boolean): any;
|
|
98
99
|
/**
|
|
99
100
|
* Apply the changes and empty the delta object
|
|
100
101
|
*/
|
|
@@ -845,10 +845,19 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
845
845
|
var __extraProperties = object.constructor["__extraProperties"];
|
|
846
846
|
if (__extraProperties != null && __extraProperties.includes(key)) return true;
|
|
847
847
|
}
|
|
848
|
+
/* -------------------------------------------------------------------------- */
|
|
848
849
|
var __changeables = object.constructor["__changeables"];
|
|
849
850
|
var __unchangeables = object.constructor["__unchangeables"];
|
|
851
|
+
var __protectedProperties = object.constructor["__protectedProperties"];
|
|
852
|
+
/* -------------------------------------------------------------------------- */
|
|
850
853
|
if (__changeables != null && !__changeables.includes(key)) return false;
|
|
851
854
|
if (__unchangeables != null && __unchangeables.includes(key)) return false;
|
|
855
|
+
//protected keys can only be changed by the creator of this object
|
|
856
|
+
if (__protectedProperties != null && __protectedProperties.includes(key)) {
|
|
857
|
+
if (object.isNew) return true;
|
|
858
|
+
var creatorOfObject = object.get("_creator");
|
|
859
|
+
return _global.gfunc.run_action_sync("is_current_user", creatorOfObject);
|
|
860
|
+
}
|
|
852
861
|
return true;
|
|
853
862
|
}
|
|
854
863
|
}, {
|
|
@@ -1099,6 +1108,8 @@ _defineProperty(SimpleObject, "__cache_name", void 0);
|
|
|
1099
1108
|
_defineProperty(SimpleObject, "__unchangeables", void 0);
|
|
1100
1109
|
//these properties can be directly changed and are included in deltaObject
|
|
1101
1110
|
_defineProperty(SimpleObject, "__changeables", void 0);
|
|
1111
|
+
//these properties can only be changed by the _creator
|
|
1112
|
+
_defineProperty(SimpleObject, "__protectedProperties", void 0);
|
|
1102
1113
|
//these properties usually are not directly changed and sometimes are included in deltaObject
|
|
1103
1114
|
_defineProperty(SimpleObject, "__extraProperties", void 0);
|
|
1104
1115
|
_defineProperty(SimpleObject, "__use_delta", true);
|