zet-lib 1.2.72 → 1.2.73
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/lib/zRoleRouter.js +8 -1
- package/package.json +1 -1
package/lib/zRoleRouter.js
CHANGED
|
@@ -30,21 +30,28 @@ router.get('/', csrfProtection, async function (req, res, next) {
|
|
|
30
30
|
})
|
|
31
31
|
//find all table has tabs
|
|
32
32
|
let zfields = await connection.results({ table: 'zfields' })
|
|
33
|
+
let dummies = []
|
|
33
34
|
let tabs = []
|
|
34
35
|
zfields.map((item) => {
|
|
35
36
|
let itemTabs = item.tabs || []
|
|
36
37
|
if (itemTabs.length) {
|
|
37
38
|
tabs.push(item.table)
|
|
38
39
|
}
|
|
40
|
+
if (item.json) {
|
|
41
|
+
if (item.json.dummy == 1) {
|
|
42
|
+
dummies.push(item.table)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
39
45
|
})
|
|
40
46
|
const json = model[0].params
|
|
41
|
-
const routes = zRole.routes
|
|
47
|
+
const routes = zRole.routes.filter((item) => !dummies.includes(item))
|
|
42
48
|
const results = await connection.results({ table: 'zrole' })
|
|
43
49
|
const myLevel = zRole.myLevel(req, res, 'zrole')
|
|
44
50
|
//inject to end body
|
|
45
51
|
let datas = {
|
|
46
52
|
model: model,
|
|
47
53
|
tabs: tabs,
|
|
54
|
+
dummies: dummies,
|
|
48
55
|
table: 'zrole',
|
|
49
56
|
id: id,
|
|
50
57
|
actions: zRole.actions,
|