Skip to content
Snippets Groups Projects
Commit a9883542 authored by Mihail Hagiu's avatar Mihail Hagiu
Browse files

fix(authsome-mode): deny access to manuscript from link

parent 70184d67
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!195feat(authsome-mode): Added rule for PATCH collection
......@@ -342,6 +342,11 @@ async function applyAdminPolicy(user, operation, object, context) {
async function applyEditorInChiefPolicy(user, operation, object, context) {
if (operation === 'GET') {
if (get(object, 'type') === 'collection') {
if (
!filterDraftCollections(object) ||
!filterTechnicalChecksCollections(object)
)
return false
return {
filter: collection => ({
...collection,
......@@ -353,6 +358,17 @@ async function applyEditorInChiefPolicy(user, operation, object, context) {
}
}
if (get(object, 'type') === 'fragment') {
const collection = await context.models.Collection.find(
get(object, 'collectionId'),
)
if (
!filterDraftCollections(collection) ||
!filterTechnicalChecksCollections(collection)
)
return false
}
if (get(object, 'path') === '/api/users') {
return helpers.getUsersList({ UserModel: context.models.User, user })
}
......
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