@openinc/parse-server-opendash 4.8.0 → 4.8.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.
|
@@ -62,11 +62,17 @@ async function init() {
|
|
|
62
62
|
// gates the button in the UI now gates the write as well. Until this,
|
|
63
63
|
// `can-perform-execution` only hid a button: anyone who could reach the
|
|
64
64
|
// Parse class could sign a protocol.
|
|
65
|
+
//
|
|
66
|
+
// Takes the session token from `request`, not from `request.user`, and that
|
|
67
|
+
// is not a style choice: `defaultHandler` above does
|
|
68
|
+
// `request.user.fetch({ useMasterKey: true })`, which refetches the *same*
|
|
69
|
+
// `Parse.User` instance in place. `_User` has no `sessionToken` column — it
|
|
70
|
+
// lives in `_Session` — so the fetch leaves the object without one, and
|
|
71
|
+
// every later `user.getSessionToken()` returns undefined. `beforeSaveHook`
|
|
72
|
+
// captures the token at trigger entry, before any of this runs, which is
|
|
73
|
+
// why every other call site passes `request` and works.
|
|
65
74
|
if (object.isNew()) {
|
|
66
|
-
await (0, index_js_2.requirePermission)(
|
|
67
|
-
sessionToken: user?.getSessionToken(),
|
|
68
|
-
master: request.master,
|
|
69
|
-
}, Permissions_js_1.Permissions.SERVICE.execution_perform, "perform a maintenance execution");
|
|
75
|
+
await (0, index_js_2.requirePermission)(request, Permissions_js_1.Permissions.SERVICE.execution_perform, "perform a maintenance execution");
|
|
70
76
|
}
|
|
71
77
|
// Who performed it is established by the server from the session, not
|
|
72
78
|
// accepted from the client. A protocol that names somebody else is worth
|