Skip to content

Commit da6dee6

Browse files
author
Maksym Mykhailenko
committed
fix: "generalPermission" middleware
1 parent f09e4df commit da6dee6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/permissions/generalPermission.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = permissions => async (req) => {
3838
// if one of the `permission` requires to know Project Members, but current route doesn't belong to any project
3939
// this means such `permission` most likely has been applied by mistake, so we throw an error
4040
const permissionsRequireProjectMembers = _.isArray(permissions)
41-
? _.some(permissions, permission => util.hasPermissionByReq(permission, req))
41+
? _.some(permissions, permission => util.isPermissionRequireProjectMembers(permission))
4242
: util.isPermissionRequireProjectMembers(permissions);
4343

4444
if (_.isUndefined(req.params.projectId) && permissionsRequireProjectMembers) {
@@ -60,6 +60,7 @@ module.exports = permissions => async (req) => {
6060
// - if user has permissions to access endpoint even we don't know if he is a member or no,
6161
// then code would proceed and endpoint would decide to throw 404 if project doesn't exist
6262
// or perform endpoint operation if loading project members above failed because of some other reason
63+
req.log.error(`Cannot load project members: ${err.message}.`);
6364
}
6465
}
6566

0 commit comments

Comments
 (0)