fix: add perm check on user email awaiting

This commit is contained in:
Shrihari Mahabal 2026-04-24 17:10:50 +05:30
parent 1cf89c9bc9
commit c19dd276ba

View file

@ -1038,6 +1038,9 @@ def has_email_account(email: str):
@frappe.whitelist(allow_guest=False)
def get_email_awaiting(user: str):
if user != frappe.session.user:
frappe.has_permission("User", "read", doc=user, throw=True)
return frappe.get_all(
"User Email",
fields=["email_account", "email_id"],