diff options
Diffstat (limited to 'src/application/views/view_post.php')
-rw-r--r-- | src/application/views/view_post.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/application/views/view_post.php b/src/application/views/view_post.php index 62b2d18..0f86896 100644 --- a/src/application/views/view_post.php +++ b/src/application/views/view_post.php @@ -5,6 +5,7 @@ use mystic\forum\orm\Attachment; /** @var mystic\forum\orm\Post $post */ /** @var mystic\forum\orm\User $postAuthor */ +/** @var mystic\forum\orm\Topic $topic */ $isImage = fn(string $m) => str_starts_with($m, "image/") || str_starts_with($m, "video/"); @@ -16,6 +17,8 @@ $canReply = $GLOBALS["currentUser"]?->hasPermission(UserPermissions::CREATE_OWN_ $canEdit = ($GLOBALS["currentUser"]?->id === $postAuthor?->id && $postAuthor?->hasPermission(UserPermissions::EDIT_OWN_POST)) || ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::EDIT_OTHER_POST)); +$canEdit = $canEdit && !$topic->isLocked; + $canDelete = ($GLOBALS["currentUser"]?->id === $postAuthor?->id && $postAuthor?->hasPermission(UserPermissions::DELETE_OWN_POST)) || ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::DELETE_OTHER_POST)); |