zet-lib 1.2.70 → 1.2.71

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.
Files changed (2) hide show
  1. package/lib/zRoute.js +16 -0
  2. package/package.json +1 -1
package/lib/zRoute.js CHANGED
@@ -1228,6 +1228,12 @@ zRoute.selectAllowedField = (req, res, MYMODEL, arr = []) => {
1228
1228
  }
1229
1229
 
1230
1230
  zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
1231
+ const levels = zRole.myLevel(req, res, MYMODEL.table);
1232
+ if(!levels.export) {
1233
+ res.json("no access")
1234
+ return false;
1235
+ }
1236
+
1231
1237
  let virtuals = []
1232
1238
  let customs = []
1233
1239
  let asDate = []
@@ -1348,6 +1354,11 @@ zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
1348
1354
 
1349
1355
  // for excels
1350
1356
  zRoute.excel = async (req, res, MYMODEL, fields, rows, callback, fileName) => {
1357
+ const levels = zRole.myLevel(req, res, MYMODEL.table);
1358
+ if(!levels.export) {
1359
+ res.json("no access")
1360
+ return false;
1361
+ }
1351
1362
  //if any other custom value then callback needed
1352
1363
  callback = callback || function () {}
1353
1364
  const workbook = new Excel.Workbook()
@@ -3546,6 +3557,11 @@ zRoute.deleteSQL = async (table, id, company_id) => {
3546
3557
 
3547
3558
  //for import
3548
3559
  zRoute.import = async (req, res, MYMODEL) => {
3560
+ const levels = zRole.myLevel(req, res, MYMODEL.table);
3561
+ if(!levels.import) {
3562
+ res.json("no access")
3563
+ return false;
3564
+ }
3549
3565
  const userId = res.locals.userId
3550
3566
  const room = res.locals.token
3551
3567
  let progress = 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.2.70",
3
+ "version": "1.2.71",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"