fix: import permissions

For some reason not importing this is causing issue with running the
functionality directly; specifically when running from background job.
This commit is contained in:
Ankush Menat 2022-01-14 18:03:21 +05:30
parent 6f8f792c01
commit d09fd25ad7

View file

@ -188,6 +188,8 @@ class Document(BaseDocument):
is not set.
:param permtype: one of `read`, `write`, `submit`, `cancel`, `delete`"""
import frappe.permissions
if self.flags.ignore_permissions:
return True
return frappe.permissions.has_permission(self.doctype, permtype, self, verbose=verbose)