fix: consider read permlevel access for select
This commit is contained in:
parent
2b37d4770f
commit
90c28c0f6b
1 changed files with 5 additions and 1 deletions
|
|
@ -868,7 +868,11 @@ def has_child_permission(
|
||||||
return False
|
return False
|
||||||
|
|
||||||
permlevel = parent_meta.get_field(parentfield).permlevel
|
permlevel = parent_meta.get_field(parentfield).permlevel
|
||||||
accessible_permlevels = parent_meta.get_permlevel_access(ptype, user=user)
|
# checking for select == checking for "select or read"
|
||||||
|
# select does not support access of higher permlevel child tables, but read does
|
||||||
|
accessible_permlevels = parent_meta.get_permlevel_access(
|
||||||
|
"read" if ptype == "select" else ptype, user=user
|
||||||
|
)
|
||||||
if permlevel > 0 and permlevel not in accessible_permlevels:
|
if permlevel > 0 and permlevel not in accessible_permlevels:
|
||||||
push_perm_check_log(
|
push_perm_check_log(
|
||||||
_("Insufficient Permission Level for {0}").format(frappe.bold(parent_doctype)), debug=debug
|
_("Insufficient Permission Level for {0}").format(frappe.bold(parent_doctype)), debug=debug
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue