Merge pull request #30042 from akhilnarang/fix-printview-check-order

refactor(printview): first check for doc permissions, then for website
This commit is contained in:
Akhil Narang 2025-01-24 17:01:04 +05:30 committed by GitHub
commit bea4dc68fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -375,13 +375,13 @@ def get_rendered_raw_commands(doc: str, name: str | None = None, print_format: s
def validate_print_permission(doc: "Document") -> None:
if frappe.has_website_permission(doc):
return
for ptype in ("read", "print"):
if frappe.has_permission(doc.doctype, ptype, doc):
return
if frappe.has_website_permission(doc):
return
if (key := frappe.form_dict.key) and isinstance(key, str):
validate_key(key, doc)
return