fix(discussion_topic): add perm. check to submit_discussion method
Users should not be able to edit someone else's replies. Forbidding it w/ this check.
This commit is contained in:
parent
cc519fd4ad
commit
befd7f313c
1 changed files with 2 additions and 0 deletions
|
|
@ -33,6 +33,8 @@ def submit_discussion(
|
|||
):
|
||||
if reply_name:
|
||||
doc = frappe.get_doc("Discussion Reply", reply_name)
|
||||
if doc.owner != frappe.session.user:
|
||||
frappe.throw(frappe._("You can only edit your own replies."), frappe.PermissionError)
|
||||
doc.reply = reply
|
||||
doc.save(ignore_permissions=True)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue