refactor(printview): first check for doc permissions, then for website
This broke for some cases because people had doc permissions, but `has_website_permission()` returns False Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
1e8a1f64c5
commit
bbfb26aaab
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