fix: Add authorization checks on internal functions (backport #55709) (backport #55726) (#55736)

Co-authored-by: Ankush Menat <ankush@frappe.io>
fix: Add authorization checks on internal functions (backport #55709) (#55726)
fix: Add authorization checks on internal functions (#55709)
This commit is contained in:
mergify[bot]
2026-06-16 21:34:10 +00:00
committed by GitHub
parent 5f5b2a6ae2
commit 8c7a313a38
15 changed files with 21 additions and 35 deletions

View File

@@ -326,6 +326,9 @@ def deactivate_sales_person(status=None, employee=None):
@frappe.whitelist()
def create_user(employee, user=None, email=None):
emp = frappe.get_doc("Employee", employee)
emp.check_permission("write")
if emp.user_id:
frappe.throw(_("Employee {0} already has a linked user").format(emp.name))
employee_name = emp.employee_name.split(" ")
middle_name = last_name = ""