From c838a10bcee88b63225f9679468d6d26bd181b74 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Mon, 18 Jan 2021 01:40:04 -0600 Subject: [PATCH] Adds checks for mod permissions to delete posts in board --- post.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/post.php b/post.php index 5254e6fa..48f7ab90 100644 --- a/post.php +++ b/post.php @@ -213,12 +213,16 @@ function handle_delete(){ // Check if board exists if (!openBoard($_POST['board'])) error($config['error']['noboard']); + + // Check if mod has permission to delete posts in this board + if ($is_mod && !hasPermission($config['mod']['delete'], $board)) + error($config['error']['noaccess']); // Check if banned checkBan($board['uri']); - // Check if deletion enabled - if (!$config['allow_delete']) + // Check if deletion is enabled + if (!$is_mod && !$config['allow_delete']) error(_('Post deletion is not allowed!')); if (empty($delete))