mandarina-server 2.8.5 → 2.9.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.
|
@@ -92,12 +92,12 @@ var CustomAction = /** @class */ (function () {
|
|
|
92
92
|
if (permissions.includes('nobody')) {
|
|
93
93
|
throw new Error('Action not allowed');
|
|
94
94
|
}
|
|
95
|
-
if (permissions.includes('everybody')
|
|
96
|
-
console.log(
|
|
95
|
+
if (!permissions.includes('everybody') && !permissions.some(function (p) { return roles.includes(p); })) {
|
|
96
|
+
console.log("***************", "Action \"".concat(action, "\" not allowed for this user"), "***************");
|
|
97
97
|
console.warn(user && user.id, action);
|
|
98
98
|
console.warn(user && user.roles, permissions);
|
|
99
|
-
console.log(
|
|
100
|
-
|
|
99
|
+
console.log("*****************************************************************************");
|
|
100
|
+
throw new Error("Action \"".concat(action, "\" not allowed for this user"));
|
|
101
101
|
}
|
|
102
102
|
return [4 /*yield*/, actions[action].action(_, args, context, info)];
|
|
103
103
|
case 2:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mandarina-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Mandarina for server side",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/lodash": ">=4.14.192",
|
|
24
24
|
"@types/node": ">=12.0.10",
|
|
25
25
|
"lodash": ">=4.17.21",
|
|
26
|
-
"mandarina": "2.
|
|
26
|
+
"mandarina": "2.9.0",
|
|
27
27
|
"prisma-binding": ">=2.3.15"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"graphql-yoga": "^5.17.0",
|
|
34
34
|
"jest": "^30.2.0",
|
|
35
35
|
"ts-jest": "29.4.5",
|
|
36
|
-
"mandarina": "2.
|
|
36
|
+
"mandarina": "2.9.0",
|
|
37
37
|
"prisma-binding": "^2.3.15",
|
|
38
38
|
"typescript": "4.9.5"
|
|
39
39
|
},
|
|
@@ -67,12 +67,18 @@ export class CustomAction {
|
|
|
67
67
|
if (permissions.includes('nobody')){
|
|
68
68
|
throw new Error('Action not allowed')
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
if (!permissions.includes('everybody') && !permissions.some(p => roles.includes(p))) {
|
|
71
|
+
console.log(
|
|
72
|
+
"***************",
|
|
73
|
+
`Action "${action}" not allowed for this user`,
|
|
74
|
+
"***************"
|
|
75
|
+
);
|
|
76
|
+
console.warn(user && user.id, action);
|
|
77
|
+
console.warn(user && user.roles, permissions);
|
|
78
|
+
console.log(
|
|
79
|
+
"*****************************************************************************"
|
|
80
|
+
);
|
|
81
|
+
throw new Error(`Action "${action}" not allowed for this user`)
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
const result = await actions[action].action(_, args, context, info)
|