corebasic 1.0.119 → 1.0.121

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/libs/features.js CHANGED
@@ -66,7 +66,7 @@ export const send = async (meta, feature, data, params) => {
66
66
  url: `${service}${url}`,
67
67
  headers: { jwt: SERVICE_ACCESS_TOKEN, service: true },
68
68
  data: payload,
69
- timeout: 1000
69
+ timeout: 3000
70
70
  })).data;
71
71
  }
72
72
 
@@ -77,6 +77,8 @@ const check = async (company, user, feature, req) => {
77
77
  export const checkRequest = async (req) => {
78
78
  let meta = {...req.body, data: undefined}
79
79
  req.meta = meta
80
+ if (req.body.feature === 'outlets.query.list') // Starting point for atleast selecting an outlet. (This is a Special Case)
81
+ return true
80
82
  return await check(req.body.company, req.body.user, req.body.feature, req)
81
83
  }
82
84
 
@@ -86,7 +88,7 @@ export const checkRequest = async (req) => {
86
88
  const getRoles = async (company, user, req) => {
87
89
  let staff = (await Dip.query(req.meta, "staff", { user: user }))[0]
88
90
  if (staff?._id === `${company}_DEFAULT`) // Company Creator Admin Access
89
- return true
91
+ return [req.body.feature]
90
92
  let roles = (await Dip.query(req.meta, "privileges.staff", { _id: staff._id }))[0].items.map(item => item._id)
91
93
  return getAllowedFeatures(company, roles)
92
94
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.119",
4
+ "version": "1.0.121",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {