fix(get_linked_docs): check if user can read doctype before fetching a list
Users might not have access to all the possible linked doctypes - they should still be able to access the others Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
00fb8e7a7a
commit
80d20ff745
1 changed files with 4 additions and 0 deletions
|
|
@ -430,6 +430,10 @@ def get_linked_docs(doctype: str, name: str, linkinfo: dict | None = None) -> di
|
|||
is_target_doctype_table = frappe.get_meta(doctype).istable
|
||||
|
||||
for linked_doctype, link_context in linkinfo.items():
|
||||
# Don't try to fetch linked documents if the user can't read the doctype
|
||||
if not frappe.has_permission(linked_doctype):
|
||||
continue
|
||||
|
||||
linked_doctype_meta = frappe.get_meta(linked_doctype)
|
||||
|
||||
if linked_doctype_meta.issingle:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue