fix: add perm check on unfollow doc
This commit is contained in:
parent
56c602e94d
commit
a87e2654c7
1 changed files with 1 additions and 1 deletions
|
|
@ -77,7 +77,7 @@ def follow_document(doctype: str, doc_name: str, user: str) -> Document | bool:
|
|||
|
||||
@frappe.whitelist()
|
||||
def unfollow_document(doctype: str, doc_name: str, user: str) -> bool:
|
||||
if user != frappe.session.user:
|
||||
if user != frappe.session.user and not frappe.has_permission("Document Follow", "write"):
|
||||
frappe.throw(_("You can only unfollow documents for yourself."), frappe.PermissionError)
|
||||
|
||||
doc = frappe.get_all(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue