Skip to content

Commit

Permalink
[COM-657] - add check for private discussions so that we can ignore m…
Browse files Browse the repository at this point in the history
…inimum tag count on them
  • Loading branch information
ajaypayne committed Mar 19, 2021
1 parent bd1bd09 commit 2b19e09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Listener/SaveTagsToDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public function handle(Saving $event)
throw new PermissionDeniedException;
}

if (! $actor->can('bypassTagCounts', $discussion)) {
$isPrivate = $event->data['relationships']['recipientUsers'] !== null;
if (! $actor->can('bypassTagCounts', $discussion) && !$isPrivate) {
$this->validateTagCount('primary', $primaryCount);
$this->validateTagCount('secondary', $secondaryCount);
}
Expand Down

0 comments on commit 2b19e09

Please sign in to comment.