mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03: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
e7786ca482
commit
4282ead3a7
@ -160,7 +160,8 @@ class CommentsService {
|
||||
id: member
|
||||
}, {
|
||||
require: true,
|
||||
...options
|
||||
...options,
|
||||
withRelated: ['products']
|
||||
});
|
||||
|
||||
this.checkCommentAccess(memberModel);
|
||||
@ -169,7 +170,8 @@ class CommentsService {
|
||||
id: post
|
||||
}, {
|
||||
require: true,
|
||||
...options
|
||||
...options,
|
||||
withRelated: ['tiers']
|
||||
});
|
||||
|
||||
this.checkPostAccess(postModel, memberModel);
|
||||
@ -208,7 +210,8 @@ class CommentsService {
|
||||
id: member
|
||||
}, {
|
||||
require: true,
|
||||
...options
|
||||
...options,
|
||||
withRelated: ['products']
|
||||
});
|
||||
|
||||
this.checkCommentAccess(memberModel);
|
||||
@ -229,7 +232,8 @@ class CommentsService {
|
||||
id: parentComment.get('post_id')
|
||||
}, {
|
||||
require: true,
|
||||
...options
|
||||
...options,
|
||||
withRelated: ['tiers']
|
||||
});
|
||||
|
||||
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…
Reference in New Issue
Block a user