mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
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
This commit is contained in:
parent
c18527de44
commit
cf5ff983c7
@ -18,10 +18,6 @@ var EditorEditRoute = AuthenticatedRoute.extend(base, {
|
|||||||
|
|
||||||
post = this.store.getById('post', postId);
|
post = this.store.getById('post', postId);
|
||||||
|
|
||||||
if (post) {
|
|
||||||
return post;
|
|
||||||
}
|
|
||||||
|
|
||||||
paginationSettings = {
|
paginationSettings = {
|
||||||
id: postId,
|
id: postId,
|
||||||
status: 'all',
|
status: 'all',
|
||||||
@ -36,7 +32,7 @@ var EditorEditRoute = AuthenticatedRoute.extend(base, {
|
|||||||
return self.store.find('post', paginationSettings).then(function (records) {
|
return self.store.find('post', paginationSettings).then(function (records) {
|
||||||
var post = records.get('firstObject');
|
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
|
// do not show the post if they are an author but not this posts author
|
||||||
post = null;
|
post = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user