mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Fix bad logic in edit permission that was allowing guests to edit posts. Closes #88
This commit is contained in:
parent
88fee92cd5
commit
089dafa93d
|
@ -197,8 +197,10 @@ class CoreServiceProvider extends ServiceProvider
|
|||
// someone else.
|
||||
Post::grantPermission('edit', function ($grant, $user) {
|
||||
$grant->where('user_id', $user->id)
|
||||
->whereNull('hide_user_id')
|
||||
->where(function ($query) use ($user) {
|
||||
$query->whereNull('hide_user_id')
|
||||
->orWhere('hide_user_id', $user->id);
|
||||
});
|
||||
// @todo add limitations to time etc. according to a config setting
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user