fix: check only select perm instead of read or select
This commit is contained in:
parent
f342ab8ff4
commit
aef4d4bfc3
2 changed files with 3 additions and 3 deletions
|
|
@ -472,7 +472,7 @@ def validate_link_and_fetch(
|
|||
if is_virtual_dt:
|
||||
try:
|
||||
doc = frappe.get_doc(doctype, docname)
|
||||
doc.check_permission("select" if frappe.only_has_select_perm(doctype) else "read")
|
||||
doc.check_permission("select")
|
||||
values = {"name": doc.name}
|
||||
|
||||
except frappe.DoesNotExistError:
|
||||
|
|
|
|||
|
|
@ -1405,7 +1405,7 @@ class Engine:
|
|||
return parsed_order_fields
|
||||
|
||||
def check_read_permission(self):
|
||||
"""Check if user has read permission on the doctype"""
|
||||
"""Check if user has select permission on the doctype"""
|
||||
|
||||
def has_permission(ptype):
|
||||
return frappe.has_permission(
|
||||
|
|
@ -1415,7 +1415,7 @@ class Engine:
|
|||
parent_doctype=self.parent_doctype,
|
||||
)
|
||||
|
||||
if not has_permission("select") and not has_permission("read"):
|
||||
if not has_permission("select"):
|
||||
self._raise_permission_error()
|
||||
|
||||
def _raise_permission_error(self, doctype=None):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue