not-node 6.3.46 → 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 "";
|