Skip to content

Commit

Permalink
allow replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Nov 12, 2024
1 parent 8c17d56 commit 715508e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Repository/BestAnswerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public function canSelectBestAnswer(User $user, Discussion $discussion): bool
return false;
}

return self::tagEnabledForBestAnswer($discussion) && ($user->id === $discussion->user_id
return $this->tagEnabledForBestAnswer($discussion) && ($user->id === $discussion->user_id
? $user->can('selectBestAnswerOwnDiscussion', $discussion)
: $user->can('selectBestAnswerNotOwnDiscussion', $discussion));
}

public function canSelectPostAsBestAnswer(User $user, Post $post): bool
{
if (!self::canSelectBestAnswer($user, $post->discussion)) {
if (!$this->canSelectBestAnswer($user, $post->discussion)) {
return false;
}

Expand All @@ -79,7 +79,7 @@ public function canSelectPostAsBestAnswer(User $user, Post $post): bool

public function canRemoveBestAnswer(User $user, Discussion $discussion): bool
{
return self::canSelectBestAnswer($user, $discussion);
return $this->canSelectBestAnswer($user, $discussion);
}

public function tagEnabledForBestAnswer(Discussion $discussion): bool
Expand Down Expand Up @@ -184,7 +184,7 @@ public function setBestAnswer(Discussion $discussion, User $actor, int $id): voi
}
}

protected function changeTags(Discussion $discussion, string $method)
public function changeTags(Discussion $discussion, string $method)
{
$tagsToChange = @json_decode($this->settings->get('fof-best-answer.select_best_answer_tags'));

Expand Down

0 comments on commit 715508e

Please sign in to comment.