Custom child tables cannot be fetched with frappe.client.get_value or frappe.client.get_list

I have found what seems to be an oversight in check_parent_permission
If you add a child table to an existing doctype as a custom field and then try to fetch just the associated table with a frappe client method such as the function frappe.client.get_list.
It will always fail with a permissions error because this function

def check_parent_permission(parent, child_doctype):
if parent:
# User may pass fake parent and get the information from the child table
if child_doctype and not frappe.db.exists(‘DocField’,
{‘parent’: parent, ‘options’: child_doctype}):
raise frappe.PermissionError

	if frappe.permissions.has_permission(parent):
		return
# Either parent not passed or the user doesn't have permission on parent doctype of child table!
raise frappe.PermissionError

Does not check the tabCustom Field table

1 Like

This was fixed in Dec 2021, but unfortunately not yet included in a v13 release (only the v14 beta).

https://github.com/frappe/frappe/commit/33b7d7d74f0c97dc43e297ae260d7fd30cfc7959