mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🐛 Fixed commenting on tier-only posts (#15333)
fixes https://github.com/TryGhost/Team/issues/1860 **Problem:** Members were not able to comment on a post that was only visible for members with a specific tier. **Causes:** Content gating was done on models with missing relations. - The products relation was not loaded on the member when doing content gating - The tiers relation was not loaded on the post when doing content gating **Tests:** - Added for tier-only posts - Added for paid-only commenting
This commit is contained in:
parent
aec2badc6c
commit
8cd2b3182a
3 changed files with 2643 additions and 670 deletions
|
@ -160,7 +160,8 @@ class CommentsService {
|
||||||
id: member
|
id: member
|
||||||
}, {
|
}, {
|
||||||
require: true,
|
require: true,
|
||||||
...options
|
...options,
|
||||||
|
withRelated: ['products']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.checkCommentAccess(memberModel);
|
this.checkCommentAccess(memberModel);
|
||||||
|
@ -169,7 +170,8 @@ class CommentsService {
|
||||||
id: post
|
id: post
|
||||||
}, {
|
}, {
|
||||||
require: true,
|
require: true,
|
||||||
...options
|
...options,
|
||||||
|
withRelated: ['tiers']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.checkPostAccess(postModel, memberModel);
|
this.checkPostAccess(postModel, memberModel);
|
||||||
|
@ -208,7 +210,8 @@ class CommentsService {
|
||||||
id: member
|
id: member
|
||||||
}, {
|
}, {
|
||||||
require: true,
|
require: true,
|
||||||
...options
|
...options,
|
||||||
|
withRelated: ['products']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.checkCommentAccess(memberModel);
|
this.checkCommentAccess(memberModel);
|
||||||
|
@ -229,7 +232,8 @@ class CommentsService {
|
||||||
id: parentComment.get('post_id')
|
id: parentComment.get('post_id')
|
||||||
}, {
|
}, {
|
||||||
require: true,
|
require: true,
|
||||||
...options
|
...options,
|
||||||
|
withRelated: ['tiers']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.checkPostAccess(postModel, memberModel);
|
this.checkPostAccess(postModel, memberModel);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue