refactor: remove redundant share check in check_read_permission
has_permission() already checks for shared documents internally when role permissions do not grant access, so the separate frappe.share.get_shared() call was dead code.
This commit is contained in:
parent
5297edc732
commit
bcac30836b
1 changed files with 4 additions and 6 deletions
|
|
@ -1154,12 +1154,10 @@ class Engine:
|
|||
)
|
||||
|
||||
if not has_permission("select") and not has_permission("read"):
|
||||
# Check for shared documents
|
||||
if not frappe.share.get_shared(self.doctype, self.user):
|
||||
frappe.throw(
|
||||
_("Insufficient Permission for {0}").format(frappe.bold(self.doctype)),
|
||||
frappe.PermissionError,
|
||||
)
|
||||
frappe.throw(
|
||||
_("Insufficient Permission for {0}").format(frappe.bold(self.doctype)),
|
||||
frappe.PermissionError,
|
||||
)
|
||||
|
||||
def apply_field_permissions(self):
|
||||
"""Filter the list of fields based on permlevel."""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue