Merge pull request #38876 from ShrihariMahabal/check-perm-on-user-email-awaiting
fix: add perm check on user email awaiting
This commit is contained in:
commit
6284ad13cd
1 changed files with 3 additions and 0 deletions
|
|
@ -1043,6 +1043,9 @@ def has_email_account(email: str):
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=False)
|
@frappe.whitelist(allow_guest=False)
|
||||||
def get_email_awaiting(user: str):
|
def get_email_awaiting(user: str):
|
||||||
|
if user != frappe.session.user:
|
||||||
|
frappe.has_permission("User", "read", doc=user, throw=True)
|
||||||
|
|
||||||
return frappe.get_all(
|
return frappe.get_all(
|
||||||
"User Email",
|
"User Email",
|
||||||
fields=["email_account", "email_id"],
|
fields=["email_account", "email_id"],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue