feat: get current session user roles if uid is not provided (#26808)

This commit is contained in:
Devin Slauenwhite 2024-11-06 05:18:59 -05:00 committed by GitHub
parent 4000cba810
commit e8d9bd39c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -845,7 +845,7 @@ def get_all_roles():
@frappe.whitelist()
def get_roles(arg=None):
"""get roles for a user"""
return frappe.get_roles(frappe.form_dict["uid"])
return frappe.get_roles(frappe.form_dict.get("uid", frappe.session.user))
@frappe.whitelist()