fix(projects): check read permission on source in create_duplicate_project

(cherry picked from commit 8c8b282a2e)
This commit is contained in:
Shllokkk
2026-08-21 13:17:47 +05:30
committed by Mergify
parent c656497aac
commit af8c010aa8

View File

@@ -596,6 +596,10 @@ def create_duplicate_project(prev_doc, project_name):
prev_doc = json.loads(prev_doc)
# prev_doc is caller-supplied, but the tasks below are read from the db by name
if source_name := prev_doc.get("name"):
frappe.has_permission("Project", "read", source_name, throw=True)
if project_name == prev_doc.get("name"):
frappe.throw(_("Use a name that is different from previous project name"))