Skip to content

Commit cec1f36

Browse files
committed
✨ l'auteur de l'article peut voir un article pas encore approuve
1 parent 9486dde commit cec1f36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Http/Controllers/ArticlesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function show(Article $article)
3030
$article = Cache::remember('post-' . $article->id, now()->addHour(), fn () => $article);
3131

3232
abort_unless(
33-
$article->isPublished() || ($user && $user->hasAnyRole(['admin', 'moderator'])),
33+
$article->isPublished() || ($user && $article->isAuthoredBy($user)) || ($user && $user->hasAnyRole(['admin', 'moderator'])),
3434
404
3535
);
3636

0 commit comments

Comments
 (0)