mirror of
https://github.com/flarum/framework.git
synced 2025-04-01 13:25:13 +08:00
Only check for reply permission for actual replies. fixes #917
This commit is contained in:
parent
d4a333e2b8
commit
cc36542b40
@ -74,7 +74,11 @@ class PostReplyHandler
|
|||||||
// it, check if they have permission to reply.
|
// it, check if they have permission to reply.
|
||||||
$discussion = $this->discussions->findOrFail($command->discussionId, $actor);
|
$discussion = $this->discussions->findOrFail($command->discussionId, $actor);
|
||||||
|
|
||||||
|
// If this is the first post in the discussion, it's technically not a
|
||||||
|
// "reply", so we won't check for that permission.
|
||||||
|
if ($discussion->number_index > 0) {
|
||||||
$this->assertCan($actor, 'reply', $discussion);
|
$this->assertCan($actor, 'reply', $discussion);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a new Post entity, persist it, and dispatch domain events.
|
// Create a new Post entity, persist it, and dispatch domain events.
|
||||||
// Before persistence, though, fire an event to give plugins an
|
// Before persistence, though, fire an event to give plugins an
|
||||||
|
Loading…
x
Reference in New Issue
Block a user