From e8cc077bda683e6f79df8aae33c3513d7be8366e Mon Sep 17 00:00:00 2001 From: DavidJForgeFlow Date: Fri, 17 Nov 2023 11:58:08 +0100 Subject: [PATCH] [IMP] web_notify When trying to use the notify function that comes from a normal user with sudo flag enabled, it wasn't letting the user access it. Adding the su flag to the check should allow sudo users using this feature. --- web_notify/models/res_users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_notify/models/res_users.py b/web_notify/models/res_users.py index d973940ea..7e5660a78 100644 --- a/web_notify/models/res_users.py +++ b/web_notify/models/res_users.py @@ -56,7 +56,7 @@ class ResUsers(models.Model): self, type_message=DEFAULT, message=DEFAULT_MESSAGE, title=None, sticky=False ): # pylint: disable=protected-access - if not self.env.user._is_admin() and any( + if not (self.env.user._is_admin() or self.env.su) and any( user.id != self.env.uid for user in self ): raise exceptions.UserError(