not-node 6.3.45 → 6.3.47
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
CHANGED
package/src/fields/filter.js
CHANGED
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
const { getSafeFieldsForRoleAction } = require("../auth/fields");
|
|
8
8
|
const { DEFAULT_USER_ROLE_FOR_GUEST } = require("../auth/const");
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* notFieldsFilter.filter(fields, getApp().getModelSchema(MODEL_NAME), {action});
|
|
11
11
|
*
|
|
12
12
|
* usage:
|
|
13
13
|
* manifest = {
|
|
@@ -17,7 +17,7 @@ const { DEFAULT_USER_ROLE_FOR_GUEST } = require("../auth/const");
|
|
|
17
17
|
* list:{
|
|
18
18
|
* rules:[{
|
|
19
19
|
* root: true,
|
|
20
|
-
* fields:
|
|
20
|
+
* fields: notFieldsFilter.filter(['@*'], getApp().getModelSchema(MODEL_NAME), {action:read});
|
|
21
21
|
* }]
|
|
22
22
|
* },
|
|
23
23
|
* profile:{
|
|
@@ -2,6 +2,7 @@ const merge = require("deepmerge");
|
|
|
2
2
|
const Auth = require("../auth");
|
|
3
3
|
const notFieldsFilter = require("../fields/filter");
|
|
4
4
|
const getApp = require("../getApp");
|
|
5
|
+
const { firstLetterToUpper } = require("../common");
|
|
5
6
|
|
|
6
7
|
const DIRTY_FIELDS = [
|
|
7
8
|
"rules",
|
|
@@ -32,7 +33,7 @@ module.exports = class notManifestFilter {
|
|
|
32
33
|
**/
|
|
33
34
|
static filterRoute(route, auth, role, root, moduleName = "") {
|
|
34
35
|
let result = JSON.parse(JSON.stringify(route));
|
|
35
|
-
const modelName = result.
|
|
36
|
+
const modelName = result.model;
|
|
36
37
|
result.actions = {};
|
|
37
38
|
if (!route || !route.actions) {
|
|
38
39
|
return result;
|
|
@@ -167,9 +168,9 @@ module.exports = class notManifestFilter {
|
|
|
167
168
|
static composeFullModelName(moduleName, modelName) {
|
|
168
169
|
if (modelName) {
|
|
169
170
|
if (moduleName) {
|
|
170
|
-
return `${moduleName}//${modelName}`;
|
|
171
|
+
return `${moduleName}//${firstLetterToUpper(modelName)}`;
|
|
171
172
|
} else {
|
|
172
|
-
return `${modelName}`;
|
|
173
|
+
return `${firstLetterToUpper(modelName)}`;
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
return "";
|
package/src/manifest/route.js
CHANGED
|
@@ -228,7 +228,7 @@ class notRoute {
|
|
|
228
228
|
}
|
|
229
229
|
if (Array.isArray(result)) {
|
|
230
230
|
result = result.map((itm) =>
|
|
231
|
-
itm.toObject ? itm.toObject() : itm
|
|
231
|
+
itm && itm.toObject ? itm.toObject() : itm
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
234
|
notManifestRouteResultFilter.filter(req.notRouteData, result);
|