@teamkeel/functions-runtime 0.363.1 → 0.364.0
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/package.json +1 -1
- package/src/consts.js +8 -8
- package/src/tryExecuteFunction.js +1 -1
package/package.json
CHANGED
package/src/consts.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const PROTO_ACTION_TYPES = {
|
|
2
|
-
UNKNOWN: "
|
|
3
|
-
CREATE: "
|
|
4
|
-
GET: "
|
|
5
|
-
LIST: "
|
|
6
|
-
UPDATE: "
|
|
7
|
-
DELETE: "
|
|
8
|
-
READ: "
|
|
9
|
-
WRITE: "
|
|
2
|
+
UNKNOWN: "ACTION_TYPE_UNKNOWN",
|
|
3
|
+
CREATE: "ACTION_TYPE_CREATE",
|
|
4
|
+
GET: "ACTION_TYPE_GET",
|
|
5
|
+
LIST: "ACTION_TYPE_LIST",
|
|
6
|
+
UPDATE: "ACTION_TYPE_UPDATE",
|
|
7
|
+
DELETE: "ACTION_TYPE_DELETE",
|
|
8
|
+
READ: "ACTION_TYPE_READ",
|
|
9
|
+
WRITE: "ACTION_TYPE_WRITE",
|
|
10
10
|
JOB: "JOB_TYPE",
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ function tryExecuteFunction(
|
|
|
16
16
|
return withPermissions(permitted, async ({ getPermissionState }) => {
|
|
17
17
|
return withDatabase(db, actionType, async ({ transaction }) => {
|
|
18
18
|
const fnResult = await cb();
|
|
19
|
-
// api.permissions maintains an internal state of whether the current
|
|
19
|
+
// api.permissions maintains an internal state of whether the current function has been *explicitly* permitted/denied by the user in the course of their custom function, or if execution has already been permitted by a role based permission (evaluated in the main runtime).
|
|
20
20
|
// we need to check that the final state is permitted or unpermitted. if it's not, then it means that the user has taken no explicit action to permit/deny
|
|
21
21
|
// and therefore we default to checking the permissions defined in the schema automatically.
|
|
22
22
|
switch (getPermissionState()) {
|