parse 4.0.1-beta.1 → 4.1.0-alpha.1
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/parse.js +17994 -26193
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +8738 -17728
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Analytics.js +2 -20
- package/lib/browser/AnonymousUtils.js +6 -35
- package/lib/browser/Cloud.js +12 -70
- package/lib/browser/CloudCode.js +0 -3
- package/lib/browser/CoreManager.js +46 -184
- package/lib/browser/CryptoController.js +2 -16
- package/lib/browser/EventEmitter.js +1 -1
- package/lib/browser/EventuallyQueue.js +277 -824
- package/lib/browser/FacebookUtils.js +6 -35
- package/lib/browser/IndexedDBStorageController.js +3 -14
- package/lib/browser/InstallationController.js +2 -13
- package/lib/browser/LiveQueryClient.js +87 -204
- package/lib/browser/LiveQuerySubscription.js +10 -39
- package/lib/browser/LocalDatastore.js +451 -1081
- package/lib/browser/LocalDatastoreController.js +145 -602
- package/lib/browser/LocalDatastoreController.react-native.js +137 -573
- package/lib/browser/LocalDatastoreUtils.js +2 -12
- package/lib/browser/ObjectStateMutations.js +18 -121
- package/lib/browser/OfflineQuery.js +42 -222
- package/lib/browser/Parse.js +12 -106
- package/lib/browser/ParseACL.js +33 -141
- package/lib/browser/ParseCLP.js +96 -314
- package/lib/browser/ParseConfig.js +18 -88
- package/lib/browser/ParseError.js +63 -90
- package/lib/browser/ParseFile.js +128 -685
- package/lib/browser/ParseGeoPoint.js +23 -82
- package/lib/browser/ParseHooks.js +1 -34
- package/lib/browser/ParseInstallation.js +4 -32
- package/lib/browser/ParseLiveQuery.js +96 -505
- package/lib/browser/ParseObject.js +628 -1840
- package/lib/browser/ParseOp.js +41 -287
- package/lib/browser/ParsePolygon.js +13 -63
- package/lib/browser/ParseQuery.js +404 -1505
- package/lib/browser/ParseRelation.js +12 -61
- package/lib/browser/ParseRole.js +13 -75
- package/lib/browser/ParseSchema.js +49 -201
- package/lib/browser/ParseSession.js +11 -69
- package/lib/browser/ParseUser.js +274 -1127
- package/lib/browser/Push.js +7 -43
- package/lib/browser/RESTController.js +18 -140
- package/lib/browser/SingleInstanceStateController.js +19 -137
- package/lib/browser/Socket.weapp.js +2 -12
- package/lib/browser/Storage.js +10 -73
- package/lib/browser/StorageController.browser.js +4 -17
- package/lib/browser/StorageController.default.js +4 -17
- package/lib/browser/StorageController.react-native.js +6 -33
- package/lib/browser/StorageController.weapp.js +5 -16
- package/lib/browser/TaskQueue.js +1 -22
- package/lib/browser/UniqueInstanceStateController.js +19 -142
- package/lib/browser/Xhr.weapp.js +0 -17
- package/lib/browser/arrayContainsObject.js +2 -16
- package/lib/browser/canBeSerialized.js +3 -33
- package/lib/browser/decode.js +3 -33
- package/lib/browser/encode.js +9 -70
- package/lib/browser/equals.js +2 -25
- package/lib/browser/escape.js +1 -8
- package/lib/browser/isRevocableSession.js +2 -11
- package/lib/browser/parseDate.js +2 -13
- package/lib/browser/promiseUtils.js +3 -21
- package/lib/browser/unique.js +3 -17
- package/lib/browser/unsavedChildren.js +6 -50
- package/lib/browser/uuid.js +3 -1
- package/lib/node/Analytics.js +1 -18
- package/lib/node/AnonymousUtils.js +5 -37
- package/lib/node/Cloud.js +10 -66
- package/lib/node/CloudCode.js +0 -3
- package/lib/node/CoreManager.js +47 -220
- package/lib/node/CryptoController.js +2 -16
- package/lib/node/EventEmitter.js +1 -1
- package/lib/node/EventuallyQueue.js +16 -123
- package/lib/node/FacebookUtils.js +5 -37
- package/lib/node/IndexedDBStorageController.js +3 -19
- package/lib/node/InstallationController.js +2 -15
- package/lib/node/LiveQueryClient.js +56 -136
- package/lib/node/LiveQuerySubscription.js +7 -16
- package/lib/node/LocalDatastore.js +19 -175
- package/lib/node/LocalDatastoreController.js +6 -38
- package/lib/node/LocalDatastoreController.react-native.js +6 -45
- package/lib/node/LocalDatastoreUtils.js +1 -6
- package/lib/node/ObjectStateMutations.js +13 -93
- package/lib/node/OfflineQuery.js +20 -152
- package/lib/node/Parse.js +11 -99
- package/lib/node/ParseACL.js +32 -150
- package/lib/node/ParseCLP.js +69 -262
- package/lib/node/ParseConfig.js +16 -84
- package/lib/node/ParseError.js +61 -65
- package/lib/node/ParseFile.js +49 -205
- package/lib/node/ParseGeoPoint.js +21 -82
- package/lib/node/ParseHooks.js +0 -35
- package/lib/node/ParseInstallation.js +1 -10
- package/lib/node/ParseLiveQuery.js +10 -36
- package/lib/node/ParseObject.js +193 -939
- package/lib/node/ParseOp.js +31 -255
- package/lib/node/ParsePolygon.js +12 -62
- package/lib/node/ParseQuery.js +170 -882
- package/lib/node/ParseRelation.js +11 -61
- package/lib/node/ParseRole.js +10 -57
- package/lib/node/ParseSchema.js +46 -222
- package/lib/node/ParseSession.js +8 -50
- package/lib/node/ParseUser.js +107 -576
- package/lib/node/Push.js +4 -37
- package/lib/node/RESTController.js +8 -110
- package/lib/node/SingleInstanceStateController.js +17 -130
- package/lib/node/Socket.weapp.js +2 -9
- package/lib/node/Storage.js +10 -83
- package/lib/node/StorageController.browser.js +4 -23
- package/lib/node/StorageController.default.js +5 -21
- package/lib/node/StorageController.react-native.js +6 -40
- package/lib/node/StorageController.weapp.js +6 -21
- package/lib/node/TaskQueue.js +1 -17
- package/lib/node/UniqueInstanceStateController.js +16 -133
- package/lib/node/Xhr.weapp.js +0 -15
- package/lib/node/arrayContainsObject.js +1 -12
- package/lib/node/canBeSerialized.js +2 -28
- package/lib/node/decode.js +1 -26
- package/lib/node/encode.js +3 -54
- package/lib/node/equals.js +0 -18
- package/lib/node/escape.js +1 -6
- package/lib/node/isRevocableSession.js +1 -5
- package/lib/node/parseDate.js +1 -7
- package/lib/node/promiseUtils.js +2 -14
- package/lib/node/unique.js +1 -11
- package/lib/node/unsavedChildren.js +2 -38
- package/lib/node/uuid.js +6 -1
- package/lib/react-native/Analytics.js +0 -9
- package/lib/react-native/AnonymousUtils.js +0 -10
- package/lib/react-native/Cloud.js +0 -26
- package/lib/react-native/CoreManager.js +1 -5
- package/lib/react-native/CryptoController.js +0 -2
- package/lib/react-native/EventEmitter.js +0 -2
- package/lib/react-native/EventuallyQueue.js +4 -52
- package/lib/react-native/FacebookUtils.js +0 -22
- package/lib/react-native/IndexedDBStorageController.js +0 -1
- package/lib/react-native/InstallationController.js +0 -6
- package/lib/react-native/LiveQueryClient.js +24 -101
- package/lib/react-native/LiveQuerySubscription.js +3 -27
- package/lib/react-native/LocalDatastore.js +6 -113
- package/lib/react-native/LocalDatastoreController.js +0 -21
- package/lib/react-native/LocalDatastoreController.react-native.js +4 -31
- package/lib/react-native/LocalDatastoreUtils.js +0 -1
- package/lib/react-native/ObjectStateMutations.js +0 -34
- package/lib/react-native/OfflineQuery.js +2 -137
- package/lib/react-native/Parse.js +0 -65
- package/lib/react-native/ParseACL.js +0 -44
- package/lib/react-native/ParseCLP.js +32 -96
- package/lib/react-native/ParseConfig.js +0 -42
- package/lib/react-native/ParseError.js +1 -21
- package/lib/react-native/ParseFile.js +3 -72
- package/lib/react-native/ParseGeoPoint.js +0 -17
- package/lib/react-native/ParseHooks.js +0 -30
- package/lib/react-native/ParseInstallation.js +1 -23
- package/lib/react-native/ParseLiveQuery.js +3 -25
- package/lib/react-native/ParseObject.js +4 -371
- package/lib/react-native/ParseOp.js +1 -138
- package/lib/react-native/ParsePolygon.js +0 -24
- package/lib/react-native/ParseQuery.js +6 -262
- package/lib/react-native/ParseRelation.js +0 -25
- package/lib/react-native/ParseRole.js +1 -36
- package/lib/react-native/ParseSchema.js +0 -51
- package/lib/react-native/ParseSession.js +1 -40
- package/lib/react-native/ParseUser.js +1 -224
- package/lib/react-native/Push.js +0 -16
- package/lib/react-native/RESTController.js +1 -70
- package/lib/react-native/SingleInstanceStateController.js +0 -44
- package/lib/react-native/Socket.weapp.js +2 -12
- package/lib/react-native/Storage.js +0 -24
- package/lib/react-native/StorageController.browser.js +0 -2
- package/lib/react-native/StorageController.default.js +0 -1
- package/lib/react-native/StorageController.react-native.js +0 -2
- package/lib/react-native/TaskQueue.js +0 -15
- package/lib/react-native/UniqueInstanceStateController.js +0 -47
- package/lib/react-native/Xhr.weapp.js +0 -16
- package/lib/react-native/arrayContainsObject.js +0 -5
- package/lib/react-native/canBeSerialized.js +0 -18
- package/lib/react-native/decode.js +0 -21
- package/lib/react-native/encode.js +0 -25
- package/lib/react-native/equals.js +0 -18
- package/lib/react-native/escape.js +0 -1
- package/lib/react-native/isRevocableSession.js +0 -1
- package/lib/react-native/parseDate.js +0 -3
- package/lib/react-native/promiseUtils.js +0 -13
- package/lib/react-native/unique.js +0 -4
- package/lib/react-native/unsavedChildren.js +0 -21
- package/lib/react-native/uuid.js +3 -1
- package/lib/weapp/Analytics.js +2 -20
- package/lib/weapp/AnonymousUtils.js +6 -35
- package/lib/weapp/Cloud.js +12 -70
- package/lib/weapp/CloudCode.js +0 -3
- package/lib/weapp/CoreManager.js +46 -184
- package/lib/weapp/CryptoController.js +2 -16
- package/lib/weapp/EventEmitter.js +1 -1
- package/lib/weapp/EventuallyQueue.js +277 -824
- package/lib/weapp/FacebookUtils.js +6 -35
- package/lib/weapp/IndexedDBStorageController.js +3 -14
- package/lib/weapp/InstallationController.js +2 -13
- package/lib/weapp/LiveQueryClient.js +87 -204
- package/lib/weapp/LiveQuerySubscription.js +10 -39
- package/lib/weapp/LocalDatastore.js +451 -1081
- package/lib/weapp/LocalDatastoreController.js +145 -602
- package/lib/weapp/LocalDatastoreController.react-native.js +137 -573
- package/lib/weapp/LocalDatastoreUtils.js +2 -12
- package/lib/weapp/ObjectStateMutations.js +18 -121
- package/lib/weapp/OfflineQuery.js +42 -222
- package/lib/weapp/Parse.js +12 -106
- package/lib/weapp/ParseACL.js +33 -141
- package/lib/weapp/ParseCLP.js +96 -314
- package/lib/weapp/ParseConfig.js +18 -88
- package/lib/weapp/ParseError.js +63 -90
- package/lib/weapp/ParseFile.js +129 -686
- package/lib/weapp/ParseGeoPoint.js +23 -82
- package/lib/weapp/ParseHooks.js +1 -34
- package/lib/weapp/ParseInstallation.js +4 -32
- package/lib/weapp/ParseLiveQuery.js +96 -505
- package/lib/weapp/ParseObject.js +628 -1840
- package/lib/weapp/ParseOp.js +41 -287
- package/lib/weapp/ParsePolygon.js +13 -63
- package/lib/weapp/ParseQuery.js +404 -1505
- package/lib/weapp/ParseRelation.js +12 -61
- package/lib/weapp/ParseRole.js +13 -75
- package/lib/weapp/ParseSchema.js +49 -201
- package/lib/weapp/ParseSession.js +11 -69
- package/lib/weapp/ParseUser.js +274 -1127
- package/lib/weapp/Push.js +7 -43
- package/lib/weapp/RESTController.js +18 -140
- package/lib/weapp/SingleInstanceStateController.js +19 -137
- package/lib/weapp/Socket.weapp.js +2 -12
- package/lib/weapp/Storage.js +10 -73
- package/lib/weapp/StorageController.browser.js +4 -17
- package/lib/weapp/StorageController.default.js +4 -17
- package/lib/weapp/StorageController.react-native.js +6 -33
- package/lib/weapp/StorageController.weapp.js +5 -16
- package/lib/weapp/TaskQueue.js +1 -22
- package/lib/weapp/UniqueInstanceStateController.js +19 -142
- package/lib/weapp/Xhr.weapp.js +0 -17
- package/lib/weapp/arrayContainsObject.js +2 -16
- package/lib/weapp/canBeSerialized.js +3 -33
- package/lib/weapp/decode.js +3 -33
- package/lib/weapp/encode.js +9 -70
- package/lib/weapp/equals.js +2 -25
- package/lib/weapp/escape.js +1 -8
- package/lib/weapp/isRevocableSession.js +2 -11
- package/lib/weapp/parseDate.js +2 -13
- package/lib/weapp/promiseUtils.js +3 -21
- package/lib/weapp/unique.js +3 -17
- package/lib/weapp/unsavedChildren.js +6 -50
- package/lib/weapp/uuid.js +1 -6
- package/package.json +48 -46
package/lib/node/ParseCLP.js
CHANGED
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _ParseRole = _interopRequireDefault(require("./ParseRole"));
|
|
9
|
-
|
|
10
8
|
var _ParseUser = _interopRequireDefault(require("./ParseUser"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) {
|
|
13
10
|
return obj && obj.__esModule ? obj : {
|
|
14
11
|
default: obj
|
|
@@ -18,11 +15,10 @@ function _interopRequireDefault(obj) {
|
|
|
18
15
|
* @flow
|
|
19
16
|
*/
|
|
20
17
|
|
|
21
|
-
|
|
22
18
|
const PUBLIC_KEY = '*';
|
|
23
|
-
const VALID_PERMISSIONS
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const VALID_PERMISSIONS /*: Map<string, UsersMap>*/ = new Map(
|
|
20
|
+
/*:: <string, UsersMap>*/
|
|
21
|
+
);
|
|
26
22
|
VALID_PERMISSIONS.set('get', {});
|
|
27
23
|
VALID_PERMISSIONS.set('find', {});
|
|
28
24
|
VALID_PERMISSIONS.set('count', {});
|
|
@@ -30,10 +26,11 @@ VALID_PERMISSIONS.set('create', {});
|
|
|
30
26
|
VALID_PERMISSIONS.set('update', {});
|
|
31
27
|
VALID_PERMISSIONS.set('delete', {});
|
|
32
28
|
VALID_PERMISSIONS.set('addField', {});
|
|
33
|
-
const VALID_PERMISSIONS_EXTENDED
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const VALID_PERMISSIONS_EXTENDED /*: Map<string, UsersMap>*/ = new Map(
|
|
30
|
+
/*:: <string, UsersMap>*/
|
|
31
|
+
);
|
|
36
32
|
VALID_PERMISSIONS_EXTENDED.set('protectedFields', {});
|
|
33
|
+
|
|
37
34
|
/**
|
|
38
35
|
* Creates a new CLP.
|
|
39
36
|
* If no argument is given, the CLP has no permissions for anyone.
|
|
@@ -126,68 +123,52 @@ VALID_PERMISSIONS_EXTENDED.set('protectedFields', {});
|
|
|
126
123
|
*
|
|
127
124
|
* @alias Parse.CLP
|
|
128
125
|
*/
|
|
129
|
-
|
|
130
126
|
class ParseCLP {
|
|
131
127
|
/*:: permissionsMap: PermissionsMap;*/
|
|
132
|
-
|
|
133
128
|
/**
|
|
134
129
|
* @param {(Parse.User | Parse.Role | object)} userId The user to initialize the CLP for
|
|
135
130
|
*/
|
|
136
|
-
constructor(userId
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
this.permissionsMap = {}; // Initialize permissions Map with default permissions
|
|
140
|
-
|
|
131
|
+
constructor(userId /*: ParseUser | ParseRole | PermissionsMap*/) {
|
|
132
|
+
this.permissionsMap = {};
|
|
133
|
+
// Initialize permissions Map with default permissions
|
|
141
134
|
for (const [operation, group] of VALID_PERMISSIONS.entries()) {
|
|
142
135
|
this.permissionsMap[operation] = Object.assign({}, group);
|
|
143
136
|
const action = operation.charAt(0).toUpperCase() + operation.slice(1);
|
|
144
|
-
|
|
145
137
|
this[`get${action}RequiresAuthentication`] = function () {
|
|
146
138
|
return this._getAccess(operation, 'requiresAuthentication');
|
|
147
139
|
};
|
|
148
|
-
|
|
149
140
|
this[`set${action}RequiresAuthentication`] = function (allowed) {
|
|
150
141
|
this._setAccess(operation, 'requiresAuthentication', allowed);
|
|
151
142
|
};
|
|
152
|
-
|
|
153
143
|
this[`get${action}PointerFields`] = function () {
|
|
154
144
|
return this._getAccess(operation, 'pointerFields', false);
|
|
155
145
|
};
|
|
156
|
-
|
|
157
146
|
this[`set${action}PointerFields`] = function (pointerFields) {
|
|
158
147
|
this._setArrayAccess(operation, 'pointerFields', pointerFields);
|
|
159
148
|
};
|
|
160
|
-
|
|
161
149
|
this[`get${action}Access`] = function (entity) {
|
|
162
150
|
return this._getAccess(operation, entity);
|
|
163
151
|
};
|
|
164
|
-
|
|
165
152
|
this[`set${action}Access`] = function (entity, allowed) {
|
|
166
153
|
this._setAccess(operation, entity, allowed);
|
|
167
154
|
};
|
|
168
|
-
|
|
169
155
|
this[`getPublic${action}Access`] = function () {
|
|
170
156
|
return this[`get${action}Access`](PUBLIC_KEY);
|
|
171
157
|
};
|
|
172
|
-
|
|
173
158
|
this[`setPublic${action}Access`] = function (allowed) {
|
|
174
159
|
this[`set${action}Access`](PUBLIC_KEY, allowed);
|
|
175
160
|
};
|
|
176
|
-
|
|
177
161
|
this[`getRole${action}Access`] = function (role) {
|
|
178
162
|
return this[`get${action}Access`](this._getRoleName(role));
|
|
179
163
|
};
|
|
180
|
-
|
|
181
164
|
this[`setRole${action}Access`] = function (role, allowed) {
|
|
182
165
|
this[`set${action}Access`](this._getRoleName(role), allowed);
|
|
183
166
|
};
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
167
|
+
}
|
|
168
|
+
// Initialize permissions Map with default extended permissions
|
|
187
169
|
for (const [operation, group] of VALID_PERMISSIONS_EXTENDED.entries()) {
|
|
188
170
|
this.permissionsMap[operation] = Object.assign({}, group);
|
|
189
171
|
}
|
|
190
|
-
|
|
191
172
|
if (userId && typeof userId === 'object') {
|
|
192
173
|
if (userId instanceof _ParseUser.default) {
|
|
193
174
|
this.setReadAccess(userId, true);
|
|
@@ -201,11 +182,9 @@ class ParseCLP {
|
|
|
201
182
|
const isValidPermission = !!VALID_PERMISSIONS.get(permission);
|
|
202
183
|
const isValidPermissionExtended = !!VALID_PERMISSIONS_EXTENDED.get(permission);
|
|
203
184
|
const isValidGroupPermission = ['readUserFields', 'writeUserFields'].includes(permission);
|
|
204
|
-
|
|
205
185
|
if (typeof permission !== 'string' || !(isValidPermission || isValidPermissionExtended || isValidGroupPermission)) {
|
|
206
186
|
throw new TypeError('Tried to create an CLP with an invalid permission type.');
|
|
207
187
|
}
|
|
208
|
-
|
|
209
188
|
if (isValidGroupPermission) {
|
|
210
189
|
if (users.every(pointer => typeof pointer === 'string')) {
|
|
211
190
|
this.permissionsMap[permission] = users;
|
|
@@ -214,14 +193,11 @@ class ParseCLP {
|
|
|
214
193
|
throw new TypeError('Tried to create an CLP with an invalid permission value.');
|
|
215
194
|
}
|
|
216
195
|
}
|
|
217
|
-
|
|
218
196
|
for (const user in users) {
|
|
219
197
|
const allowed = users[user];
|
|
220
|
-
|
|
221
198
|
if (typeof allowed !== 'boolean' && !isValidPermissionExtended && user !== 'pointerFields') {
|
|
222
199
|
throw new TypeError('Tried to create an CLP with an invalid permission value.');
|
|
223
200
|
}
|
|
224
|
-
|
|
225
201
|
this.permissionsMap[permission][user] = allowed;
|
|
226
202
|
}
|
|
227
203
|
}
|
|
@@ -230,125 +206,85 @@ class ParseCLP {
|
|
|
230
206
|
throw new TypeError('ParseCLP constructed with a function. Did you forget ()?');
|
|
231
207
|
}
|
|
232
208
|
}
|
|
209
|
+
|
|
233
210
|
/**
|
|
234
211
|
* Returns a JSON-encoded version of the CLP.
|
|
235
212
|
*
|
|
236
213
|
* @returns {object}
|
|
237
214
|
*/
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
/*: PermissionsMap*/
|
|
242
|
-
{
|
|
243
|
-
return { ...this.permissionsMap
|
|
215
|
+
toJSON() /*: PermissionsMap*/{
|
|
216
|
+
return {
|
|
217
|
+
...this.permissionsMap
|
|
244
218
|
};
|
|
245
219
|
}
|
|
220
|
+
|
|
246
221
|
/**
|
|
247
222
|
* Returns whether this CLP is equal to another object
|
|
248
223
|
*
|
|
249
224
|
* @param other The other object to compare to
|
|
250
225
|
* @returns {boolean}
|
|
251
226
|
*/
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
equals(other
|
|
255
|
-
/*: ParseCLP*/
|
|
256
|
-
)
|
|
257
|
-
/*: boolean*/
|
|
258
|
-
{
|
|
227
|
+
equals(other /*: ParseCLP*/) /*: boolean*/{
|
|
259
228
|
if (!(other instanceof ParseCLP)) {
|
|
260
229
|
return false;
|
|
261
230
|
}
|
|
262
|
-
|
|
263
231
|
const permissions = Object.keys(this.permissionsMap);
|
|
264
232
|
const otherPermissions = Object.keys(other.permissionsMap);
|
|
265
|
-
|
|
266
233
|
if (permissions.length !== otherPermissions.length) {
|
|
267
234
|
return false;
|
|
268
235
|
}
|
|
269
|
-
|
|
270
236
|
for (const permission in this.permissionsMap) {
|
|
271
237
|
if (!other.permissionsMap[permission]) {
|
|
272
238
|
return false;
|
|
273
239
|
}
|
|
274
|
-
|
|
275
240
|
const users = Object.keys(this.permissionsMap[permission]);
|
|
276
241
|
const otherUsers = Object.keys(other.permissionsMap[permission]);
|
|
277
|
-
|
|
278
242
|
if (users.length !== otherUsers.length) {
|
|
279
243
|
return false;
|
|
280
244
|
}
|
|
281
|
-
|
|
282
245
|
for (const user in this.permissionsMap[permission]) {
|
|
283
246
|
if (!other.permissionsMap[permission][user]) {
|
|
284
247
|
return false;
|
|
285
248
|
}
|
|
286
|
-
|
|
287
249
|
if (this.permissionsMap[permission][user] !== other.permissionsMap[permission][user]) {
|
|
288
250
|
return false;
|
|
289
251
|
}
|
|
290
252
|
}
|
|
291
253
|
}
|
|
292
|
-
|
|
293
254
|
return true;
|
|
294
255
|
}
|
|
295
|
-
|
|
296
|
-
_getRoleName(role
|
|
297
|
-
/*: ParseRole | string*/
|
|
298
|
-
)
|
|
299
|
-
/*: string*/
|
|
300
|
-
{
|
|
256
|
+
_getRoleName(role /*: ParseRole | string*/) /*: string*/{
|
|
301
257
|
let name = role;
|
|
302
|
-
|
|
303
258
|
if (role instanceof _ParseRole.default) {
|
|
304
259
|
// Normalize to the String name
|
|
305
260
|
name = role.getName();
|
|
306
261
|
}
|
|
307
|
-
|
|
308
262
|
if (typeof name !== 'string') {
|
|
309
263
|
throw new TypeError('role must be a Parse.Role or a String');
|
|
310
264
|
}
|
|
311
|
-
|
|
312
265
|
return `role:${name}`;
|
|
313
266
|
}
|
|
314
|
-
|
|
315
|
-
_parseEntity(entity
|
|
316
|
-
/*: Entity*/
|
|
317
|
-
) {
|
|
267
|
+
_parseEntity(entity /*: Entity*/) {
|
|
318
268
|
let userId = entity;
|
|
319
|
-
|
|
320
269
|
if (userId instanceof _ParseUser.default) {
|
|
321
270
|
userId = userId.id;
|
|
322
|
-
|
|
323
271
|
if (!userId) {
|
|
324
272
|
throw new Error('Cannot get access for a Parse.User without an id.');
|
|
325
273
|
}
|
|
326
274
|
} else if (userId instanceof _ParseRole.default) {
|
|
327
275
|
userId = this._getRoleName(userId);
|
|
328
276
|
}
|
|
329
|
-
|
|
330
277
|
if (typeof userId !== 'string') {
|
|
331
278
|
throw new TypeError('userId must be a string.');
|
|
332
279
|
}
|
|
333
|
-
|
|
334
280
|
return userId;
|
|
335
281
|
}
|
|
336
|
-
|
|
337
|
-
_setAccess(permission
|
|
338
|
-
/*: string*/
|
|
339
|
-
, userId
|
|
340
|
-
/*: Entity*/
|
|
341
|
-
, allowed
|
|
342
|
-
/*: boolean*/
|
|
343
|
-
) {
|
|
282
|
+
_setAccess(permission /*: string*/, userId /*: Entity*/, allowed /*: boolean*/) {
|
|
344
283
|
userId = this._parseEntity(userId);
|
|
345
|
-
|
|
346
284
|
if (typeof allowed !== 'boolean') {
|
|
347
285
|
throw new TypeError('allowed must be either true or false.');
|
|
348
286
|
}
|
|
349
|
-
|
|
350
287
|
const permissions = this.permissionsMap[permission][userId];
|
|
351
|
-
|
|
352
288
|
if (!permissions) {
|
|
353
289
|
if (!allowed) {
|
|
354
290
|
// The user already doesn't have this permission, so no action is needed
|
|
@@ -357,49 +293,29 @@ class ParseCLP {
|
|
|
357
293
|
this.permissionsMap[permission][userId] = {};
|
|
358
294
|
}
|
|
359
295
|
}
|
|
360
|
-
|
|
361
296
|
if (allowed) {
|
|
362
297
|
this.permissionsMap[permission][userId] = true;
|
|
363
298
|
} else {
|
|
364
299
|
delete this.permissionsMap[permission][userId];
|
|
365
300
|
}
|
|
366
301
|
}
|
|
367
|
-
|
|
368
|
-
_getAccess(permission
|
|
369
|
-
/*: string*/
|
|
370
|
-
, userId
|
|
371
|
-
/*: Entity*/
|
|
372
|
-
, returnBoolean = true)
|
|
373
|
-
/*: boolean | string[]*/
|
|
374
|
-
{
|
|
302
|
+
_getAccess(permission /*: string*/, userId /*: Entity*/, returnBoolean = true) /*: boolean | string[]*/{
|
|
375
303
|
userId = this._parseEntity(userId);
|
|
376
304
|
const permissions = this.permissionsMap[permission][userId];
|
|
377
|
-
|
|
378
305
|
if (returnBoolean) {
|
|
379
306
|
if (!permissions) {
|
|
380
307
|
return false;
|
|
381
308
|
}
|
|
382
|
-
|
|
383
309
|
return !!this.permissionsMap[permission][userId];
|
|
384
310
|
}
|
|
385
|
-
|
|
386
311
|
return permissions;
|
|
387
312
|
}
|
|
388
|
-
|
|
389
|
-
_setArrayAccess(permission
|
|
390
|
-
/*: string*/
|
|
391
|
-
, userId
|
|
392
|
-
/*: Entity*/
|
|
393
|
-
, fields
|
|
394
|
-
/*: string*/
|
|
395
|
-
) {
|
|
313
|
+
_setArrayAccess(permission /*: string*/, userId /*: Entity*/, fields /*: string*/) {
|
|
396
314
|
userId = this._parseEntity(userId);
|
|
397
315
|
const permissions = this.permissionsMap[permission][userId];
|
|
398
|
-
|
|
399
316
|
if (!permissions) {
|
|
400
317
|
this.permissionsMap[permission][userId] = [];
|
|
401
318
|
}
|
|
402
|
-
|
|
403
319
|
if (!fields || Array.isArray(fields) && fields.length === 0) {
|
|
404
320
|
delete this.permissionsMap[permission][userId];
|
|
405
321
|
} else if (Array.isArray(fields) && fields.every(field => typeof field === 'string')) {
|
|
@@ -408,18 +324,11 @@ class ParseCLP {
|
|
|
408
324
|
throw new TypeError('fields must be an array of strings or undefined.');
|
|
409
325
|
}
|
|
410
326
|
}
|
|
411
|
-
|
|
412
|
-
_setGroupPointerPermission(operation
|
|
413
|
-
/*: string*/
|
|
414
|
-
, pointerFields
|
|
415
|
-
/*: string[]*/
|
|
416
|
-
) {
|
|
327
|
+
_setGroupPointerPermission(operation /*: string*/, pointerFields /*: string[]*/) {
|
|
417
328
|
const fields = this.permissionsMap[operation];
|
|
418
|
-
|
|
419
329
|
if (!fields) {
|
|
420
330
|
this.permissionsMap[operation] = [];
|
|
421
331
|
}
|
|
422
|
-
|
|
423
332
|
if (!pointerFields || Array.isArray(pointerFields) && pointerFields.length === 0) {
|
|
424
333
|
delete this.permissionsMap[operation];
|
|
425
334
|
} else if (Array.isArray(pointerFields) && pointerFields.every(field => typeof field === 'string')) {
|
|
@@ -428,107 +337,74 @@ class ParseCLP {
|
|
|
428
337
|
throw new TypeError(`${operation}.pointerFields must be an array of strings or undefined.`);
|
|
429
338
|
}
|
|
430
339
|
}
|
|
431
|
-
|
|
432
|
-
_getGroupPointerPermissions(operation
|
|
433
|
-
/*: string*/
|
|
434
|
-
)
|
|
435
|
-
/*: string[]*/
|
|
436
|
-
{
|
|
340
|
+
_getGroupPointerPermissions(operation /*: string*/) /*: string[]*/{
|
|
437
341
|
return this.permissionsMap[operation];
|
|
438
342
|
}
|
|
343
|
+
|
|
439
344
|
/**
|
|
440
345
|
* Sets user pointer fields to allow permission for get/count/find operations.
|
|
441
346
|
*
|
|
442
347
|
* @param {string[]} pointerFields User pointer fields
|
|
443
348
|
*/
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
setReadUserFields(pointerFields
|
|
447
|
-
/*: string[]*/
|
|
448
|
-
) {
|
|
349
|
+
setReadUserFields(pointerFields /*: string[]*/) {
|
|
449
350
|
this._setGroupPointerPermission('readUserFields', pointerFields);
|
|
450
351
|
}
|
|
352
|
+
|
|
451
353
|
/**
|
|
452
354
|
* @returns {string[]} User pointer fields
|
|
453
355
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
getReadUserFields()
|
|
457
|
-
/*: string[]*/
|
|
458
|
-
{
|
|
356
|
+
getReadUserFields() /*: string[]*/{
|
|
459
357
|
return this._getGroupPointerPermissions('readUserFields');
|
|
460
358
|
}
|
|
359
|
+
|
|
461
360
|
/**
|
|
462
361
|
* Sets user pointer fields to allow permission for create/delete/update/addField operations
|
|
463
362
|
*
|
|
464
363
|
* @param {string[]} pointerFields User pointer fields
|
|
465
364
|
*/
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
setWriteUserFields(pointerFields
|
|
469
|
-
/*: string[]*/
|
|
470
|
-
) {
|
|
365
|
+
setWriteUserFields(pointerFields /*: string[]*/) {
|
|
471
366
|
this._setGroupPointerPermission('writeUserFields', pointerFields);
|
|
472
367
|
}
|
|
368
|
+
|
|
473
369
|
/**
|
|
474
370
|
* @returns {string[]} User pointer fields
|
|
475
371
|
*/
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
getWriteUserFields()
|
|
479
|
-
/*: string[]*/
|
|
480
|
-
{
|
|
372
|
+
getWriteUserFields() /*: string[]*/{
|
|
481
373
|
return this._getGroupPointerPermissions('writeUserFields');
|
|
482
374
|
}
|
|
375
|
+
|
|
483
376
|
/**
|
|
484
377
|
* Sets whether the given user is allowed to retrieve fields from this class.
|
|
485
378
|
*
|
|
486
379
|
* @param userId An instance of Parse.User or its objectId.
|
|
487
380
|
* @param {string[]} fields fields to be protected
|
|
488
381
|
*/
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
setProtectedFields(userId
|
|
492
|
-
/*: Entity*/
|
|
493
|
-
, fields
|
|
494
|
-
/*: string[]*/
|
|
495
|
-
) {
|
|
382
|
+
setProtectedFields(userId /*: Entity*/, fields /*: string[]*/) {
|
|
496
383
|
this._setArrayAccess('protectedFields', userId, fields);
|
|
497
384
|
}
|
|
385
|
+
|
|
498
386
|
/**
|
|
499
387
|
* Returns array of fields are accessable to this user.
|
|
500
388
|
*
|
|
501
389
|
* @param userId An instance of Parse.User or its objectId, or a Parse.Role.
|
|
502
390
|
* @returns {string[]}
|
|
503
391
|
*/
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
getProtectedFields(userId
|
|
507
|
-
/*: Entity*/
|
|
508
|
-
)
|
|
509
|
-
/*: string[]*/
|
|
510
|
-
{
|
|
392
|
+
getProtectedFields(userId /*: Entity*/) /*: string[]*/{
|
|
511
393
|
return this._getAccess('protectedFields', userId, false);
|
|
512
394
|
}
|
|
395
|
+
|
|
513
396
|
/**
|
|
514
397
|
* Sets whether the given user is allowed to read from this class.
|
|
515
398
|
*
|
|
516
399
|
* @param userId An instance of Parse.User or its objectId.
|
|
517
400
|
* @param {boolean} allowed whether that user should have read access.
|
|
518
401
|
*/
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
setReadAccess(userId
|
|
522
|
-
/*: Entity*/
|
|
523
|
-
, allowed
|
|
524
|
-
/*: boolean*/
|
|
525
|
-
) {
|
|
402
|
+
setReadAccess(userId /*: Entity*/, allowed /*: boolean*/) {
|
|
526
403
|
this._setAccess('find', userId, allowed);
|
|
527
|
-
|
|
528
404
|
this._setAccess('get', userId, allowed);
|
|
529
|
-
|
|
530
405
|
this._setAccess('count', userId, allowed);
|
|
531
406
|
}
|
|
407
|
+
|
|
532
408
|
/**
|
|
533
409
|
* Get whether the given user id is *explicitly* allowed to read from this class.
|
|
534
410
|
* Even if this returns false, the user may still be able to access it if
|
|
@@ -538,36 +414,23 @@ class ParseCLP {
|
|
|
538
414
|
* @param userId An instance of Parse.User or its objectId, or a Parse.Role.
|
|
539
415
|
* @returns {boolean}
|
|
540
416
|
*/
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
getReadAccess(userId
|
|
544
|
-
/*: Entity*/
|
|
545
|
-
)
|
|
546
|
-
/*: boolean*/
|
|
547
|
-
{
|
|
417
|
+
getReadAccess(userId /*: Entity*/) /*: boolean*/{
|
|
548
418
|
return this._getAccess('find', userId) && this._getAccess('get', userId) && this._getAccess('count', userId);
|
|
549
419
|
}
|
|
420
|
+
|
|
550
421
|
/**
|
|
551
422
|
* Sets whether the given user id is allowed to write to this class.
|
|
552
423
|
*
|
|
553
424
|
* @param userId An instance of Parse.User or its objectId, or a Parse.Role..
|
|
554
425
|
* @param {boolean} allowed Whether that user should have write access.
|
|
555
426
|
*/
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
setWriteAccess(userId
|
|
559
|
-
/*: Entity*/
|
|
560
|
-
, allowed
|
|
561
|
-
/*: boolean*/
|
|
562
|
-
) {
|
|
427
|
+
setWriteAccess(userId /*: Entity*/, allowed /*: boolean*/) {
|
|
563
428
|
this._setAccess('create', userId, allowed);
|
|
564
|
-
|
|
565
429
|
this._setAccess('update', userId, allowed);
|
|
566
|
-
|
|
567
430
|
this._setAccess('delete', userId, allowed);
|
|
568
|
-
|
|
569
431
|
this._setAccess('addField', userId, allowed);
|
|
570
432
|
}
|
|
433
|
+
|
|
571
434
|
/**
|
|
572
435
|
* Gets whether the given user id is *explicitly* allowed to write to this class.
|
|
573
436
|
* Even if this returns false, the user may still be able to write it if
|
|
@@ -577,87 +440,64 @@ class ParseCLP {
|
|
|
577
440
|
* @param userId An instance of Parse.User or its objectId, or a Parse.Role.
|
|
578
441
|
* @returns {boolean}
|
|
579
442
|
*/
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
getWriteAccess(userId
|
|
583
|
-
/*: Entity*/
|
|
584
|
-
)
|
|
585
|
-
/*: boolean*/
|
|
586
|
-
{
|
|
443
|
+
getWriteAccess(userId /*: Entity*/) /*: boolean*/{
|
|
587
444
|
return this._getAccess('create', userId) && this._getAccess('update', userId) && this._getAccess('delete', userId) && this._getAccess('addField', userId);
|
|
588
445
|
}
|
|
446
|
+
|
|
589
447
|
/**
|
|
590
448
|
* Sets whether the public is allowed to read from this class.
|
|
591
449
|
*
|
|
592
450
|
* @param {boolean} allowed
|
|
593
451
|
*/
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
setPublicReadAccess(allowed
|
|
597
|
-
/*: boolean*/
|
|
598
|
-
) {
|
|
452
|
+
setPublicReadAccess(allowed /*: boolean*/) {
|
|
599
453
|
this.setReadAccess(PUBLIC_KEY, allowed);
|
|
600
454
|
}
|
|
455
|
+
|
|
601
456
|
/**
|
|
602
457
|
* Gets whether the public is allowed to read from this class.
|
|
603
458
|
*
|
|
604
459
|
* @returns {boolean}
|
|
605
460
|
*/
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
getPublicReadAccess()
|
|
609
|
-
/*: boolean*/
|
|
610
|
-
{
|
|
461
|
+
getPublicReadAccess() /*: boolean*/{
|
|
611
462
|
return this.getReadAccess(PUBLIC_KEY);
|
|
612
463
|
}
|
|
464
|
+
|
|
613
465
|
/**
|
|
614
466
|
* Sets whether the public is allowed to write to this class.
|
|
615
467
|
*
|
|
616
468
|
* @param {boolean} allowed
|
|
617
469
|
*/
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
setPublicWriteAccess(allowed
|
|
621
|
-
/*: boolean*/
|
|
622
|
-
) {
|
|
470
|
+
setPublicWriteAccess(allowed /*: boolean*/) {
|
|
623
471
|
this.setWriteAccess(PUBLIC_KEY, allowed);
|
|
624
472
|
}
|
|
473
|
+
|
|
625
474
|
/**
|
|
626
475
|
* Gets whether the public is allowed to write to this class.
|
|
627
476
|
*
|
|
628
477
|
* @returns {boolean}
|
|
629
478
|
*/
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
getPublicWriteAccess()
|
|
633
|
-
/*: boolean*/
|
|
634
|
-
{
|
|
479
|
+
getPublicWriteAccess() /*: boolean*/{
|
|
635
480
|
return this.getWriteAccess(PUBLIC_KEY);
|
|
636
481
|
}
|
|
482
|
+
|
|
637
483
|
/**
|
|
638
484
|
* Sets whether the public is allowed to protect fields in this class.
|
|
639
485
|
*
|
|
640
486
|
* @param {string[]} fields
|
|
641
487
|
*/
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
setPublicProtectedFields(fields
|
|
645
|
-
/*: string[]*/
|
|
646
|
-
) {
|
|
488
|
+
setPublicProtectedFields(fields /*: string[]*/) {
|
|
647
489
|
this.setProtectedFields(PUBLIC_KEY, fields);
|
|
648
490
|
}
|
|
491
|
+
|
|
649
492
|
/**
|
|
650
493
|
* Gets whether the public is allowed to read fields from this class.
|
|
651
494
|
*
|
|
652
495
|
* @returns {string[]}
|
|
653
496
|
*/
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
getPublicProtectedFields()
|
|
657
|
-
/*: string[]*/
|
|
658
|
-
{
|
|
497
|
+
getPublicProtectedFields() /*: string[]*/{
|
|
659
498
|
return this.getProtectedFields(PUBLIC_KEY);
|
|
660
499
|
}
|
|
500
|
+
|
|
661
501
|
/**
|
|
662
502
|
* Gets whether users belonging to the given role are allowed
|
|
663
503
|
* to read from this class. Even if this returns false, the role may
|
|
@@ -667,15 +507,10 @@ class ParseCLP {
|
|
|
667
507
|
* @returns {boolean} true if the role has read access. false otherwise.
|
|
668
508
|
* @throws {TypeError} If role is neither a Parse.Role nor a String.
|
|
669
509
|
*/
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
getRoleReadAccess(role
|
|
673
|
-
/*: ParseRole | string*/
|
|
674
|
-
)
|
|
675
|
-
/*: boolean*/
|
|
676
|
-
{
|
|
510
|
+
getRoleReadAccess(role /*: ParseRole | string*/) /*: boolean*/{
|
|
677
511
|
return this.getReadAccess(this._getRoleName(role));
|
|
678
512
|
}
|
|
513
|
+
|
|
679
514
|
/**
|
|
680
515
|
* Gets whether users belonging to the given role are allowed
|
|
681
516
|
* to write to this user. Even if this returns false, the role may
|
|
@@ -685,15 +520,10 @@ class ParseCLP {
|
|
|
685
520
|
* @returns {boolean} true if the role has write access. false otherwise.
|
|
686
521
|
* @throws {TypeError} If role is neither a Parse.Role nor a String.
|
|
687
522
|
*/
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
getRoleWriteAccess(role
|
|
691
|
-
/*: ParseRole | string*/
|
|
692
|
-
)
|
|
693
|
-
/*: boolean*/
|
|
694
|
-
{
|
|
523
|
+
getRoleWriteAccess(role /*: ParseRole | string*/) /*: boolean*/{
|
|
695
524
|
return this.getWriteAccess(this._getRoleName(role));
|
|
696
525
|
}
|
|
526
|
+
|
|
697
527
|
/**
|
|
698
528
|
* Sets whether users belonging to the given role are allowed
|
|
699
529
|
* to read from this class.
|
|
@@ -702,15 +532,10 @@ class ParseCLP {
|
|
|
702
532
|
* @param {boolean} allowed Whether the given role can read this object.
|
|
703
533
|
* @throws {TypeError} If role is neither a Parse.Role nor a String.
|
|
704
534
|
*/
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
setRoleReadAccess(role
|
|
708
|
-
/*: ParseRole | string*/
|
|
709
|
-
, allowed
|
|
710
|
-
/*: boolean*/
|
|
711
|
-
) {
|
|
535
|
+
setRoleReadAccess(role /*: ParseRole | string*/, allowed /*: boolean*/) {
|
|
712
536
|
this.setReadAccess(this._getRoleName(role), allowed);
|
|
713
537
|
}
|
|
538
|
+
|
|
714
539
|
/**
|
|
715
540
|
* Sets whether users belonging to the given role are allowed
|
|
716
541
|
* to write to this class.
|
|
@@ -719,15 +544,10 @@ class ParseCLP {
|
|
|
719
544
|
* @param {boolean} allowed Whether the given role can write this object.
|
|
720
545
|
* @throws {TypeError} If role is neither a Parse.Role nor a String.
|
|
721
546
|
*/
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
setRoleWriteAccess(role
|
|
725
|
-
/*: ParseRole | string*/
|
|
726
|
-
, allowed
|
|
727
|
-
/*: boolean*/
|
|
728
|
-
) {
|
|
547
|
+
setRoleWriteAccess(role /*: ParseRole | string*/, allowed /*: boolean*/) {
|
|
729
548
|
this.setWriteAccess(this._getRoleName(role), allowed);
|
|
730
549
|
}
|
|
550
|
+
|
|
731
551
|
/**
|
|
732
552
|
* Gets whether users belonging to the given role are allowed
|
|
733
553
|
* to count to this user. Even if this returns false, the role may
|
|
@@ -737,15 +557,10 @@ class ParseCLP {
|
|
|
737
557
|
* @returns {string[]}
|
|
738
558
|
* @throws {TypeError} If role is neither a Parse.Role nor a String.
|
|
739
559
|
*/
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
getRoleProtectedFields(role
|
|
743
|
-
/*: ParseRole | string*/
|
|
744
|
-
)
|
|
745
|
-
/*: string[]*/
|
|
746
|
-
{
|
|
560
|
+
getRoleProtectedFields(role /*: ParseRole | string*/) /*: string[]*/{
|
|
747
561
|
return this.getProtectedFields(this._getRoleName(role));
|
|
748
562
|
}
|
|
563
|
+
|
|
749
564
|
/**
|
|
750
565
|
* Sets whether users belonging to the given role are allowed
|
|
751
566
|
* to set access field in this class.
|
|
@@ -754,17 +569,9 @@ class ParseCLP {
|
|
|
754
569
|
* @param {string[]} fields Fields to be protected by Role.
|
|
755
570
|
* @throws {TypeError} If role is neither a Parse.Role nor a String.
|
|
756
571
|
*/
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
setRoleProtectedFields(role
|
|
760
|
-
/*: ParseRole | string*/
|
|
761
|
-
, fields
|
|
762
|
-
/*: string[]*/
|
|
763
|
-
) {
|
|
572
|
+
setRoleProtectedFields(role /*: ParseRole | string*/, fields /*: string[]*/) {
|
|
764
573
|
this.setProtectedFields(this._getRoleName(role), fields);
|
|
765
574
|
}
|
|
766
|
-
|
|
767
575
|
}
|
|
768
|
-
|
|
769
576
|
var _default = ParseCLP;
|
|
770
577
|
exports.default = _default;
|