Skip to content

Commit 5ae57bd

Browse files
fix : 403 error when update post
1 parent 01adf1b commit 5ae57bd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

app/Policies/PostPolicy.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use App\Models\Post;
66
use App\Models\User;
7-
use App\Enums\PostStatus;
87

98
class PostPolicy
109
{
@@ -21,11 +20,7 @@ public function viewAny(?User $user): bool
2120
*/
2221
public function view(?User $user, Post $post): bool
2322
{
24-
if ($post->status === PostStatus::PUBLISHED) {
25-
return true;
26-
}
27-
28-
return $user && ($user->isAdmin() || $user->id === $post->author_id);
23+
return true;
2924
}
3025

3126
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy