Merge pull request #30051 from barredterra/mapper-perms-2
This commit is contained in:
commit
ba53d18642
1 changed files with 5 additions and 2 deletions
|
|
@ -66,6 +66,9 @@ def get_mapped_doc(
|
|||
ignore_child_tables=False,
|
||||
cached=False,
|
||||
):
|
||||
apply_strict_user_permissions = frappe.get_system_settings("apply_strict_user_permissions")
|
||||
|
||||
# main
|
||||
if not target_doc:
|
||||
target_doctype = table_maps[from_doctype]["doctype"]
|
||||
if table_maps[from_doctype].get("on_parent"):
|
||||
|
|
@ -87,7 +90,7 @@ def get_mapped_doc(
|
|||
else:
|
||||
ret_doc = target_doc
|
||||
|
||||
if not ignore_permissions:
|
||||
if not apply_strict_user_permissions and not ignore_permissions:
|
||||
target_doc.check_permission("create")
|
||||
|
||||
if cached:
|
||||
|
|
@ -170,7 +173,7 @@ def get_mapped_doc(
|
|||
ret_doc.run_method("after_mapping", source_doc)
|
||||
ret_doc.set_onload("load_after_mapping", True)
|
||||
|
||||
if not ignore_permissions:
|
||||
if apply_strict_user_permissions and not ignore_permissions:
|
||||
ret_doc.check_permission("create")
|
||||
|
||||
return ret_doc
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue