From 761b2a7af49d00ff1dd02dd14d975254138d3b9b Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 25 Jul 2026 00:28:42 -0400 Subject: [PATCH] Module permissions modal enforcement sweep to match its post counterpart --- agent/modals/account/account_edit.php | 2 ++ agent/modals/asset/asset_bulk_assign_contact.php | 2 ++ agent/modals/asset/asset_bulk_assign_location.php | 2 ++ agent/modals/client/client_edit.php | 2 ++ agent/modals/contact/contact_bulk_assign_location.php | 2 ++ agent/modals/document/document_add_from_template.php | 2 ++ agent/modals/document/document_bulk_move.php | 2 ++ agent/modals/document/document_move.php | 2 ++ agent/modals/document/document_rename.php | 2 ++ agent/modals/document/document_version_view.php | 2 ++ agent/modals/document/document_view.php | 2 ++ agent/modals/expense/expense_edit.php | 2 ++ agent/modals/file/file_move.php | 2 ++ agent/modals/file/file_rename.php | 2 ++ agent/modals/folder/folder_rename.php | 2 ++ agent/modals/invoice/invoice_copy.php | 2 ++ agent/modals/invoice/invoice_edit.php | 2 ++ agent/modals/invoice/invoice_item_edit.php | 2 ++ agent/modals/location/location_edit.php | 2 ++ agent/modals/payment/invoice_apply_credit.php | 2 ++ agent/modals/payment/payment_edit.php | 2 ++ agent/modals/product/product_edit.php | 2 ++ agent/modals/project/project_edit.php | 2 ++ agent/modals/project/project_link_closed_ticket.php | 2 ++ agent/modals/project/project_link_ticket.php | 2 ++ agent/modals/quote/quote_copy.php | 2 ++ agent/modals/quote/quote_item_edit.php | 2 ++ agent/modals/quote/quote_to_invoice.php | 2 ++ agent/modals/recurring_expense/recurring_expense_edit.php | 2 ++ agent/modals/recurring_invoice/recurring_invoice_edit.php | 2 ++ agent/modals/recurring_invoice/recurring_invoice_item_edit.php | 2 ++ agent/modals/recurring_ticket/recurring_ticket_edit.php | 2 ++ agent/modals/service/service.php | 2 ++ agent/modals/service/service_edit.php | 2 ++ agent/modals/ticket/ticket_billable.php | 2 ++ agent/modals/trip/trip_copy.php | 2 ++ agent/modals/trip/trip_edit.php | 2 ++ agent/modals/vendor/vendor.php | 2 ++ agent/modals/vendor/vendor_edit.php | 2 ++ 39 files changed, 78 insertions(+) diff --git a/agent/modals/account/account_edit.php b/agent/modals/account/account_edit.php index 30202b77..0957b0a9 100644 --- a/agent/modals/account/account_edit.php +++ b/agent/modals/account/account_edit.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_financial', 2); + $account_id = intval($_GET['id']); $sql = mysqli_query($mysqli, "SELECT * FROM accounts WHERE account_id = $account_id LIMIT 1"); diff --git a/agent/modals/asset/asset_bulk_assign_contact.php b/agent/modals/asset/asset_bulk_assign_contact.php index 3e1d634b..b7d59e3c 100644 --- a/agent/modals/asset/asset_bulk_assign_contact.php +++ b/agent/modals/asset/asset_bulk_assign_contact.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support', 2); + $client_id = intval($_GET['client_id']); enforceClientAccess(); diff --git a/agent/modals/asset/asset_bulk_assign_location.php b/agent/modals/asset/asset_bulk_assign_location.php index 6714a4ff..37a13e6e 100644 --- a/agent/modals/asset/asset_bulk_assign_location.php +++ b/agent/modals/asset/asset_bulk_assign_location.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support', 2); + $client_id = intval($_GET['client_id']); enforceClientAccess(); diff --git a/agent/modals/client/client_edit.php b/agent/modals/client/client_edit.php index 4a3e2e7c..0cec4221 100644 --- a/agent/modals/client/client_edit.php +++ b/agent/modals/client/client_edit.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_client', 2); + $client_id = intval($_GET['id']); $sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_id = $client_id $access_permission_query LIMIT 1"); diff --git a/agent/modals/contact/contact_bulk_assign_location.php b/agent/modals/contact/contact_bulk_assign_location.php index b1da34de..4b52de6c 100644 --- a/agent/modals/contact/contact_bulk_assign_location.php +++ b/agent/modals/contact/contact_bulk_assign_location.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_client', 2); + $client_id = intval($_GET['client_id']); enforceClientAccess(); diff --git a/agent/modals/document/document_add_from_template.php b/agent/modals/document/document_add_from_template.php index a49e0432..9804619a 100644 --- a/agent/modals/document/document_add_from_template.php +++ b/agent/modals/document/document_add_from_template.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support', 2); + $client_id = intval($_GET['client_id'] ?? 0); enforceClientAccess(); diff --git a/agent/modals/document/document_bulk_move.php b/agent/modals/document/document_bulk_move.php index ddf5fe84..c1127ba5 100644 --- a/agent/modals/document/document_bulk_move.php +++ b/agent/modals/document/document_bulk_move.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support', 2); + $client_id = intval($_GET['client_id']); $selected_ids = array_map('intval', $_GET['selected_ids'] ?? []); diff --git a/agent/modals/document/document_move.php b/agent/modals/document/document_move.php index 3171a044..a44e5668 100644 --- a/agent/modals/document/document_move.php +++ b/agent/modals/document/document_move.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support', 2); + $document_id = intval($_GET['id']); $sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = $document_id LIMIT 1"); diff --git a/agent/modals/document/document_rename.php b/agent/modals/document/document_rename.php index 2fa66886..9c3ceb7f 100644 --- a/agent/modals/document/document_rename.php +++ b/agent/modals/document/document_rename.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support', 2); + $document_id = intval($_GET['id']); $sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = $document_id LIMIT 1"); diff --git a/agent/modals/document/document_version_view.php b/agent/modals/document/document_version_view.php index d935ca20..1d6f74b5 100644 --- a/agent/modals/document/document_version_view.php +++ b/agent/modals/document/document_version_view.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support'); + // Initialize the HTML Purifier to prevent XSS require_once "../../../libs/htmlpurifier/HTMLPurifier.standalone.php"; diff --git a/agent/modals/document/document_view.php b/agent/modals/document/document_view.php index 95d408eb..12bd3d1d 100644 --- a/agent/modals/document/document_view.php +++ b/agent/modals/document/document_view.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support'); + // Initialize the HTML Purifier to prevent XSS require_once "../../../libs/htmlpurifier/HTMLPurifier.standalone.php"; diff --git a/agent/modals/expense/expense_edit.php b/agent/modals/expense/expense_edit.php index 9fd3044a..b10d9b69 100644 --- a/agent/modals/expense/expense_edit.php +++ b/agent/modals/expense/expense_edit.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_financial', 2); + $expense_id = intval($_GET['id']); $sql = mysqli_query($mysqli, "SELECT * FROM expenses diff --git a/agent/modals/file/file_move.php b/agent/modals/file/file_move.php index 9ad43155..fbaa84fa 100644 --- a/agent/modals/file/file_move.php +++ b/agent/modals/file/file_move.php @@ -2,6 +2,8 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_support', 2); + $file_id = intval($_GET['id']); $sql = mysqli_query($mysqli, "SELECT * FROM files WHERE file_id = $file_id LIMIT 1"); diff --git a/agent/modals/file/file_rename.php b/agent/modals/file/file_rename.php index 83303d17..5432acb2 100644 --- a/agent/modals/file/file_rename.php +++ b/agent/modals/file/file_rename.php @@ -1,6 +1,8 @@