Skip to content
Snippets Groups Projects
Commit 547f36ce authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

Merge branch 'develop' of https://gitlab.coko.foundation/xpub/xpub-faraday into develop

parents cf0f8f92 a489ebfc
No related branches found
No related tags found
1 merge request!8Sprint #10
...@@ -7,7 +7,7 @@ const statuses = config.get('statuses') ...@@ -7,7 +7,7 @@ const statuses = config.get('statuses')
const publicStatusesPermissions = ['author', 'reviewer'] const publicStatusesPermissions = ['author', 'reviewer']
module.exports = { module.exports = {
parseReviewerAuthors: (coll, matchingCollPerm) => { parseAuthorsData: (coll, matchingCollPerm) => {
if (['reviewer'].includes(matchingCollPerm.permission)) { if (['reviewer'].includes(matchingCollPerm.permission)) {
coll.authors = coll.authors.map(a => omit(a, ['email'])) coll.authors = coll.authors.map(a => omit(a, ['email']))
} }
......
...@@ -34,7 +34,7 @@ async function teamPermissions(user, operation, object, context) { ...@@ -34,7 +34,7 @@ async function teamPermissions(user, operation, object, context) {
return null return null
} }
helpers.setPublicStatuses(coll, matchingCollPerm) helpers.setPublicStatuses(coll, matchingCollPerm)
helpers.parseReviewerAuthors(coll, matchingCollPerm) helpers.parseAuthorsData(coll, matchingCollPerm)
if ( if (
['reviewer', 'handlingEditor'].includes( ['reviewer', 'handlingEditor'].includes(
matchingCollPerm.permission, matchingCollPerm.permission,
......
...@@ -7,7 +7,7 @@ const statuses = config.get('statuses') ...@@ -7,7 +7,7 @@ const statuses = config.get('statuses')
const publicStatusesPermissions = ['author', 'reviewer'] const publicStatusesPermissions = ['author', 'reviewer']
module.exports = { module.exports = {
parseReviewerAuthors: (coll, matchingCollPerm) => { parseAuthorsData: (coll, matchingCollPerm) => {
if (['reviewer'].includes(matchingCollPerm.permission)) { if (['reviewer'].includes(matchingCollPerm.permission)) {
coll.authors = coll.authors.map(a => omit(a, ['email'])) coll.authors = coll.authors.map(a => omit(a, ['email']))
} }
......
...@@ -34,7 +34,7 @@ async function teamPermissions(user, operation, object, context) { ...@@ -34,7 +34,7 @@ async function teamPermissions(user, operation, object, context) {
return null return null
} }
helpers.setPublicStatuses(coll, matchingCollPerm) helpers.setPublicStatuses(coll, matchingCollPerm)
helpers.parseReviewerAuthors(coll, matchingCollPerm) helpers.parseAuthorsData(coll, matchingCollPerm)
if ( if (
['reviewer', 'handlingEditor'].includes( ['reviewer', 'handlingEditor'].includes(
matchingCollPerm.permission, matchingCollPerm.permission,
...@@ -153,7 +153,7 @@ async function authenticatedUser(user, operation, object, context) { ...@@ -153,7 +153,7 @@ async function authenticatedUser(user, operation, object, context) {
} }
} }
// only allow the HE to create, delete an invitation, or get inv details` // only allow the HE to create, delete an invitation, or get invitation details
if ( if (
['POST', 'GET', 'DELETE'].includes(operation) && ['POST', 'GET', 'DELETE'].includes(operation) &&
get(object.collection, 'type') === 'collection' && get(object.collection, 'type') === 'collection' &&
......
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