浏览代码

Recursive issue on checking permission for communication when it is linked to self

version-14
Nabin Hait 8 年前
父节点
当前提交
11237be4f5
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      frappe/core/doctype/communication/communication.py

+ 4
- 0
frappe/core/doctype/communication/communication.py 查看文件

@@ -264,6 +264,10 @@ def on_doctype_update():


def has_permission(doc, ptype, user): def has_permission(doc, ptype, user):
if ptype=="read": if ptype=="read":
if (doc.reference_doctype == "Communication" and doc.reference_name == doc.name) \
or (doc.timeline_doctype == "Communication" and doc.timeline_name == doc.name):
return
if doc.reference_doctype and doc.reference_name: if doc.reference_doctype and doc.reference_name:
if frappe.has_permission(doc.reference_doctype, ptype="read", doc=doc.reference_name): if frappe.has_permission(doc.reference_doctype, ptype="read", doc=doc.reference_name):
return True return True


正在加载...
取消
保存