How to assign Role from Server Script to User

I want to assign a role to New Manager of Employee when Employee Transfer is submitted after approved from old manager.

I have written Server Script for this, but User has no Administrator rights to assign role to New Manager.

Below is Server Script:

current = None
new = None
employee = doc.employee
doc_ = frappe.get_list(‘Employee Property History’, filters={‘parent’}, fields=‘*’)

for transfer in doc_:
if transfer[‘property’] == ‘Reports to’:
current = transfer[‘current’]
new = transfer[“new”]

if current and new:
doc_ = frappe.get_doc(‘Employee’, new)
new_employee_email = doc_.user_id

doc_ = frappe.get_doc("Employee", employee)
doc_.leave_approver = new_employee_email
doc_.expense_approver = new_employee_email
doc_.shift_request_approver = new_employee_email

doc = frappe.get_doc({
    'doctype': 'Has Role',
    'role': 'Employee_Transfer',
    'parenttype': 'User',
    "parentfield": 'roles'

doc.insert(ignore_permissions = True)