Merge pull request #15615 from ankush/perm_import

fix: AttributeError when calling frappe.permissions.$function
This commit is contained in:
mergify[bot] 2022-01-14 12:52:56 +00:00 committed by GitHub
commit 2ea25f0baa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)