From a9199ad9d92b2118621370335dd29ccfad7feb6e Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 27 May 2016 13:56:04 +0930 Subject: [PATCH] Only check for reply permission for actual replies. fixes #917 --- src/Core/Command/PostReplyHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Core/Command/PostReplyHandler.php b/src/Core/Command/PostReplyHandler.php index f81645866..6c4560d5f 100644 --- a/src/Core/Command/PostReplyHandler.php +++ b/src/Core/Command/PostReplyHandler.php @@ -74,7 +74,11 @@ class PostReplyHandler // it, check if they have permission to reply. $discussion = $this->discussions->findOrFail($command->discussionId, $actor); - $this->assertCan($actor, 'reply', $discussion); + // 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); + } // Create a new Post entity, persist it, and dispatch domain events. // Before persistence, though, fire an event to give plugins an