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:
commit
bea4dc68fe
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue