From dc586a6a8a164e67840813981462e92fe2aed6ad Mon Sep 17 00:00:00 2001 From: kacperduras Date: Thu, 22 Nov 2018 19:41:06 +0100 Subject: [PATCH 1/2] Fix access to the common article for multiple editors closes #10212 --- core/server/models/relations/authors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/models/relations/authors.js b/core/server/models/relations/authors.js index 9521267c466..7da57077155 100644 --- a/core/server/models/relations/authors.js +++ b/core/server/models/relations/authors.js @@ -315,7 +315,7 @@ module.exports.extendModel = function extendModel(Post, Posts, ghostBookshelf) { } function isCurrentOwner() { - return context.user === postModel.related('authors').models[0].id; + return postModel.related('authors').models.map(author => author.id).includes(context.user) } if (isContributor && isEdit) { From 5a64f2e88b44a874b2a5d85117f2f6c77c0f2932 Mon Sep 17 00:00:00 2001 From: kacperduras Date: Thu, 22 Nov 2018 19:49:53 +0100 Subject: [PATCH 2/2] Push missed changes Add missing semicolon. --- core/server/models/relations/authors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/models/relations/authors.js b/core/server/models/relations/authors.js index 7da57077155..c279ed8f879 100644 --- a/core/server/models/relations/authors.js +++ b/core/server/models/relations/authors.js @@ -315,7 +315,7 @@ module.exports.extendModel = function extendModel(Post, Posts, ghostBookshelf) { } function isCurrentOwner() { - return postModel.related('authors').models.map(author => author.id).includes(context.user) + return postModel.related('authors').models.map(author => author.id).includes(context.user); } if (isContributor && isEdit) {