From cf5ff983c74d7e2cc4b5765cb57242ca1b7e68eb Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Mon, 17 Nov 2014 23:57:00 +0100 Subject: [PATCH] Loads correct screen after author refreshes page in editor closes #4415 - corrected logic around author check - fixes a bug where it was possible to see editor for other author posts --- ghost/admin/routes/editor/edit.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ghost/admin/routes/editor/edit.js b/ghost/admin/routes/editor/edit.js index 871a8b5ecc..4c151392f5 100644 --- a/ghost/admin/routes/editor/edit.js +++ b/ghost/admin/routes/editor/edit.js @@ -18,10 +18,6 @@ var EditorEditRoute = AuthenticatedRoute.extend(base, { post = this.store.getById('post', postId); - if (post) { - return post; - } - paginationSettings = { id: postId, status: 'all', @@ -36,7 +32,7 @@ var EditorEditRoute = AuthenticatedRoute.extend(base, { return self.store.find('post', paginationSettings).then(function (records) { var post = records.get('firstObject'); - if (user.get('isAuthor') && post.isAuthoredByUser(user)) { + if (user.get('isAuthor') && !post.isAuthoredByUser(user)) { // do not show the post if they are an author but not this posts author post = null; }