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

fix(selectors): EiC cannot see edit, admin can see in all statuses except...

fix(selectors): EiC cannot see edit, admin can see in all statuses except wthdrawn, rejected, accept
parent be89e7fb
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!195feat(authsome-mode): Added rule for PATCH collection
...@@ -303,7 +303,7 @@ export const canHEOnlyReject = (collection = {}) => { ...@@ -303,7 +303,7 @@ export const canHEOnlyReject = (collection = {}) => {
return canHEOnlyRejectStatuses.includes(status) return canHEOnlyRejectStatuses.includes(status)
} }
const canEditManuscriptStatuses = ['draft', 'technicalChecks', 'inQA'] const cannotEditManuscriptStatuses = ['withdrawn', 'rejected', 'accepted']
export const canEditManuscript = (state, collection = {}, fragment = {}) => { export const canEditManuscript = (state, collection = {}, fragment = {}) => {
const isAdmin = currentUserIs(state, 'isAdmin') const isAdmin = currentUserIs(state, 'isAdmin')
if ( if (
...@@ -313,7 +313,7 @@ export const canEditManuscript = (state, collection = {}, fragment = {}) => { ...@@ -313,7 +313,7 @@ export const canEditManuscript = (state, collection = {}, fragment = {}) => {
return false return false
const status = get(collection, 'status', 'draft') const status = get(collection, 'status', 'draft')
return canEditManuscriptStatuses.includes(status) return !cannotEditManuscriptStatuses.includes(status)
} }
const canOverrideTechnicalChecksStatuses = ['technicalChecks', 'inQA'] const canOverrideTechnicalChecksStatuses = ['technicalChecks', 'inQA']
......
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