mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Only include visible posts in post linkage
This commit is contained in:
parent
3362a8c092
commit
43842623aa
|
@ -47,9 +47,10 @@ class ShowAction extends BaseAction
|
|||
{
|
||||
$include = $params->included(['startPost', 'lastPost', 'posts']);
|
||||
|
||||
$discussion = $this->discussions->findOrFail($params->get('id'), $this->actor->getUser());
|
||||
$user = $this->actor->getUser();
|
||||
|
||||
$discussion->posts_ids = $discussion->posts()->get(['id'])->fetch('id')->all();
|
||||
$discussion = $this->discussions->findOrFail($params->get('id'), $user);
|
||||
$discussion->posts_ids = $discussion->posts()->whereCan($user, 'view')->get(['id'])->fetch('id')->all();
|
||||
|
||||
if (in_array('posts', $include)) {
|
||||
$relations = ['user', 'user.groups', 'editUser', 'hideUser'];
|
||||
|
|
Loading…
Reference in New Issue
Block a user