Skip to content

Commit

Permalink
fix: respect ignore_permission flag
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Oct 25, 2024
1 parent 0c64459 commit a7e3405
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions landa/address_and_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def validate(doc, event):

doc.organization = None
for link in doc.links:
# Linking an Address or Contact should be treated like writing to the linked doc
linked_doc = frappe.get_doc(link.link_doctype, link.link_name)
linked_doc.check_permission("write")
if not doc.flags.ignore_permissions:
# Linking an Address or Contact should be treated like writing to the linked doc
linked_doc = frappe.get_doc(link.link_doctype, link.link_name)
linked_doc.check_permission("write")

if link.link_doctype == "Customer":
doc.organization = link.link_name
Expand Down

0 comments on commit a7e3405

Please sign in to comment.