mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-29 06:38:24 +00:00
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:
@@ -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 = ""
|
||||
|
||||
Reference in New Issue
Block a user