@go-mailer/jarvis 5.0.12 → 5.1.0
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/middlewares/auth.js +2 -2
- package/lib/query.js +1 -1
- package/package.json +1 -1
package/lib/middlewares/auth.js
CHANGED
|
@@ -112,8 +112,8 @@ const authenticateUser = async (request, response, next) => {
|
|
|
112
112
|
const authorizeUser = ({ action, resource }) => {
|
|
113
113
|
return async (request, response, next) => {
|
|
114
114
|
try {
|
|
115
|
-
const { is_admin, tenant_id, user_id } = request
|
|
116
|
-
if (is_admin) return next()
|
|
115
|
+
const { is_admin,is_service_request, tenant_id, user_id } = request
|
|
116
|
+
if (is_admin || is_service_request) return next()
|
|
117
117
|
|
|
118
118
|
await checkAuthority({ action, resource, tenant_id, user_id })
|
|
119
119
|
next()
|
package/lib/query.js
CHANGED
|
@@ -36,7 +36,7 @@ const buildQuery = (options) => {
|
|
|
36
36
|
delete options.sum
|
|
37
37
|
|
|
38
38
|
Object.keys(options).forEach((field) => {
|
|
39
|
-
const field_value = options[field] ? options[field].toString()
|
|
39
|
+
const field_value = options[field] ? options[field].toString() : ''
|
|
40
40
|
let condition
|
|
41
41
|
|
|
42
42
|
if (field_value.includes(':')) {
|