@openinc/parse-server-opendash 3.20.1 → 3.20.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/index.js +12 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -289,9 +289,16 @@ async function ensureRole(name, options) {
|
|
|
289
289
|
console.log("--------> Creating role");
|
|
290
290
|
role = new Parse.Role(name, acl);
|
|
291
291
|
role.set("label", label);
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
console.log("--------> CREATING role ", name);
|
|
293
|
+
try {
|
|
294
|
+
await role.save(null, {
|
|
295
|
+
useMasterKey: true,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
console.error("--------> Error creating role", error);
|
|
300
|
+
}
|
|
301
|
+
console.log("--------> NEW Role created");
|
|
295
302
|
}
|
|
296
303
|
else {
|
|
297
304
|
console.log("--------> Role already exists");
|
|
@@ -326,9 +333,10 @@ async function ensureRole(name, options) {
|
|
|
326
333
|
}
|
|
327
334
|
}
|
|
328
335
|
if (changed) {
|
|
329
|
-
console.log("--------> Saving role");
|
|
336
|
+
console.log("--------> Saving changed role");
|
|
330
337
|
await role.save(null, { useMasterKey: true });
|
|
331
338
|
}
|
|
339
|
+
console.log("--------> Exiting ensureRole");
|
|
332
340
|
}
|
|
333
341
|
/**
|
|
334
342
|
* Ensures that a user has a specific role.
|