fix: Allow only search fields for select permission type

This commit is contained in:
Gavin D'souza 2023-04-22 12:46:15 +05:30
parent 7d2f9be609
commit a1f59c5a82

View file

@ -542,12 +542,15 @@ class Meta(Document):
if self.istable and not parenttype:
return permitted_fieldnames
if not self.get_permissions(parenttype=parenttype):
return self.get_fieldnames_with_value()
if not permission_type:
permission_type = "select" if frappe.only_has_select_perm(self.name, user=user) else "read"
if permission_type == "select":
return self.get_search_fields()
if not self.get_permissions(parenttype=parenttype):
return self.get_fieldnames_with_value()
permlevel_access = set(
self.get_permlevel_access(permission_type=permission_type, parenttype=parenttype, user=user)
)