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

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

parents eed0983c e05256e4
No related branches found
No related tags found
1 merge request!6Agree/Decline to work on a manuscript
...@@ -25,25 +25,24 @@ async function teamPermissions(user, operation, object, context) { ...@@ -25,25 +25,24 @@ async function teamPermissions(user, operation, object, context) {
if (collectionsPermissions.length > 0) { if (collectionsPermissions.length > 0) {
return { return {
filter: filterParam => { filter: filterParam => {
if (filterParam.length > 0) { if (!filterParam.length) return filterParam
const collections = filterParam
.map(coll => { const collections = filterParam
const matchingCollPerm = collectionsPermissions.find( .map(coll => {
collPerm => coll.id === collPerm.id, const matchingCollPerm = collectionsPermissions.find(
) collPerm => coll.id === collPerm.id,
if (matchingCollPerm === undefined) { )
return null if (matchingCollPerm === undefined) {
} return null
coll.visibleStatus = statuses[coll.status].public }
if (!publicPermissions.includes(matchingCollPerm.permission)) { coll.visibleStatus = statuses[coll.status].public
coll.visibleStatus = statuses[coll.status].private if (!publicPermissions.includes(matchingCollPerm.permission)) {
} coll.visibleStatus = statuses[coll.status].private
return coll }
}) return coll
.filter(Boolean) })
return collections .filter(Boolean)
} return collections
return filterParam
}, },
} }
} }
......
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