[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.
pull/2673/head
DavidJForgeFlow 2023-11-17 11:58:08 +01:00
parent 2f46029928
commit e8cc077bda
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class ResUsers(models.Model):
self, type_message=DEFAULT, message=DEFAULT_MESSAGE, title=None, sticky=False self, type_message=DEFAULT, message=DEFAULT_MESSAGE, title=None, sticky=False
): ):
# pylint: disable=protected-access # 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 user.id != self.env.uid for user in self
): ):
raise exceptions.UserError( raise exceptions.UserError(