fix: Conditionally show extra info for perm error (#21660)
This commit is contained in:
parent
154a6dd9ed
commit
14798146c7
1 changed files with 4 additions and 4 deletions
|
|
@ -93,10 +93,10 @@ def has_permission(
|
|||
doc = frappe.get_doc(meta.name, doc)
|
||||
perm = get_doc_permissions(doc, user=user, ptype=ptype).get(ptype)
|
||||
if not perm:
|
||||
push_perm_check_log(
|
||||
_("User {0} does not have access to this document").format(frappe.bold(user))
|
||||
+ f": {_(doc.doctype)} - {doc.name}"
|
||||
)
|
||||
msg = _("User {0} does not have access to this document").format(frappe.bold(user))
|
||||
if frappe.has_permission(doc.doctype):
|
||||
msg += f": {_(doc.doctype)} - {doc.name}"
|
||||
push_perm_check_log(msg)
|
||||
else:
|
||||
if ptype == "submit" and not cint(meta.is_submittable):
|
||||
push_perm_check_log(_("Document Type is not submittable"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue