diff options
author | Jonas Kohl | 2024-09-19 14:19:35 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-19 14:19:35 +0200 |
commit | 95bfdb59b6a1e04e474551c23c7caef619c79839 (patch) | |
tree | 0fe7bf17c5767df5084dac05c61b4167781b9b1b /src/application/views/view_post.php | |
parent | d7faf7053803aaa9eb8ae85a864ea1b2cccaa586 (diff) |
Topic locking
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)); |