[FIX] mail: ignore abritrary argument domain for searching channel
We should not trust arbitrary arguments from public method to compose a domain as it is possible to inject '|' to disable filters and be able to search any channel (mitigated by access rules). Create a private method and use a wrapper that ignores the domain.
This commit is contained in:
@@ -500,8 +500,13 @@ class Channel(models.Model):
|
||||
values['channel_private_group'] = self.search([('channel_type', '=', 'channel'), ('public', '=', 'private'), ('channel_partner_ids', 'in', [my_partner_id])]).channel_info()
|
||||
return values
|
||||
|
||||
# TODO master: remove domain argument
|
||||
@api.model
|
||||
def channel_search_to_join(self, name=None, domain=None):
|
||||
return self._channel_search_to_join(name)
|
||||
|
||||
@api.model
|
||||
def _channel_search_to_join(self, name=None, domain=None):
|
||||
""" Return the channel info of the channel the current partner can join
|
||||
:param name : the name of the researched channels
|
||||
:param domain : the base domain of the research
|
||||
|
||||
Reference in New Issue
Block a user