Skip to content

Commit 0cb786d

Browse files
fix(notification): remove incorrect permission checks for sending notifications
1 parent 89ffac9 commit 0cb786d

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

raven_cloud/api/notification.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ def send(messages: str, site_name: str):
5959
if not frappe.db.exists('RC Site', site_name):
6060
frappe.throw(_("Site not created for the user"))
6161

62-
roles = frappe.get_roles()
63-
if "System Manager" not in roles or "Administrator" not in roles:
64-
# check if user has permission to send notifications to this site
65-
if not frappe.db.exists('RC Site User', {'site': site_name, 'user_id': frappe.session.user}):
66-
frappe.throw(_("You do not have permission to send notifications to this site."))
67-
68-
6962
if isinstance(messages, str):
7063
messages = json.loads(messages)
7164

@@ -236,12 +229,6 @@ def send_to_users(messages: str, site_name: str):
236229
if not frappe.db.exists('RC Site', site_name):
237230
frappe.throw(_("Site not registered on Raven Cloud, please ask your System Manager to register the site."))
238231

239-
roles = frappe.get_roles()
240-
if "System Manager" not in roles or "Administrator" not in roles:
241-
# check if user has permission to send notifications to this site
242-
if not frappe.db.exists('RC Site User', {'site': site_name, 'user_id': frappe.session.user}):
243-
frappe.throw(_("You do not have permission to send notifications to this site."))
244-
245232
if isinstance(messages, str):
246233
messages = json.loads(messages)
247234

0 commit comments

Comments
 (0)