Skip to content
Snippets Groups Projects
Commit 2676bb4c authored by Sebastian's avatar Sebastian
Browse files

remove coll after HE declined

parent fb9ec143
No related branches found
No related tags found
1 merge request!6Agree/Decline to work on a manuscript
......@@ -19,7 +19,7 @@ module.exports = {
coll.visibleStatus = statuses[coll.status].private
}
},
filterRefusedReviewers: (coll, user) => {
filterRefusedInvitations: (coll, user) => {
const matchingInv = coll.invitations.find(inv => inv.userId === user.id)
if (matchingInv === undefined) return null
if (matchingInv.hasAnswer === true && !matchingInv.isAccepted) return null
......
......@@ -35,8 +35,12 @@ async function teamPermissions(user, operation, object, context) {
}
helpers.setPublicStatuses(coll, matchingCollPerm)
helpers.parseReviewerAuthors(coll, matchingCollPerm)
if (['reviewer'].includes(matchingCollPerm.permission)) {
return helpers.filterRefusedReviewers(coll, user)
if (
['reviewer', 'handlingEditor'].includes(
matchingCollPerm.permission,
)
) {
return helpers.filterRefusedInvitations(coll, user)
}
return coll
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment