Skip to content

Commit 37d12ec

Browse files
fix: add client side permission check
1 parent cfa5a6f commit 37d12ec

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pdf_on_submit/public/js/pdf_button_utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ pdf_on_submit.add_pdf_button = async function (frm) {
3232

3333
frm.remove_custom_button(__("PDF"));
3434

35+
if (!frm.has_perm("print")) return;
36+
3537
frm.add_custom_button(__("PDF"), async () => {
3638
// Open the popup synchronously while still in the user-gesture context,
3739
// before any await, to avoid browser popup blockers.

0 commit comments

Comments
 (0)