fix: permission issue when cancelling evaluation

This commit is contained in:
Jannat Patel
2026-02-17 13:35:15 +05:30
parent e2ef8f732d
commit d83f3464cd
5 changed files with 18 additions and 9 deletions

View File

@@ -1308,6 +1308,7 @@ def get_lms_settings():
@frappe.whitelist()
def cancel_evaluation(evaluation: dict):
evaluation = frappe._dict(evaluation)
print(evaluation.member, frappe.session.user)
if evaluation.member != frappe.session.user:
frappe.throw(_("You do not have permission to cancel this evaluation."), frappe.PermissionError)

View File

@@ -15,6 +15,6 @@ def execute():
is_shared = frappe.db.exists("DocShare", filters)
if not is_shared:
share = frappe.new_doc("DocShare")
filters.update({"read": 1, "notify_by_email": 0})
filters.update({"read": 1, "write": 1, "notify_by_email": 0})
share.update(filters)
share.save()