mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 19:01:57 +08:00
Clarify ambiguous use of user_id
column which was crashing search queries
This commit is contained in:
parent
90d4294456
commit
d2a00225c7
|
@ -51,7 +51,7 @@ class DiscussionPolicy extends AbstractPolicy
|
|||
|
||||
if (! $actor->hasPermission('discussion.approvePosts')) {
|
||||
$query->where(function (Builder $query) use ($actor) {
|
||||
$query->where('user_id', $actor->id)
|
||||
$query->where('discussion.user_id', $actor->id)
|
||||
->orWhere($this->canApprovePosts($actor));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class PostPolicy extends AbstractPolicy
|
|||
|
||||
if (! $actor->hasPermission('discussion.approvePosts')) {
|
||||
$query->where(function (Builder $query) use ($actor) {
|
||||
$query->where('user_id', $actor->id)
|
||||
$query->where('posts.user_id', $actor->id)
|
||||
->orWhereExists($this->discussionWhereCanApprovePosts($actor));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user