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

* fix: Add authorization checks on internal functions (#55709)

(cherry picked from commit ba936eefab)

# Conflicts:
#	erpnext/accounts/doctype/pos_profile/pos_profile.py
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
#	erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py
#	erpnext/support/doctype/issue/issue.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2026-06-08 10:16:12 +00:00
committed by GitHub
parent 497c3a5e83
commit 2ae6451f10
15 changed files with 19 additions and 35 deletions

View File

@@ -427,6 +427,7 @@ def deactivate_sales_person(status=None, employee=None):
@frappe.whitelist()
def create_user(employee: str, email: str | None = None, create_user_permission: int = 0) -> str:
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))