diff --git a/base_search_mail_content/README.rst b/base_search_mail_content/README.rst index 4b9a3b95e..0d299e5fc 100644 --- a/base_search_mail_content/README.rst +++ b/base_search_mail_content/README.rst @@ -67,6 +67,15 @@ Usage Go to any model that contains a chatter (e.g. Contacts, ...). Search for content in field 'Message Content'. +Known issues / Roadmap +====================== + +- This module restricts the message_content search functionality to + internal users only, addressing the issue faced by project + collaborators (portal users) as described in + https://github.com/OCA/social/issues/1204. Consequently, portal users + no longer have the ability to search within mail content. + Bug Tracker =========== diff --git a/base_search_mail_content/models/mail_thread.py b/base_search_mail_content/models/mail_thread.py index 43a57df70..9c8f453d6 100644 --- a/base_search_mail_content/models/mail_thread.py +++ b/base_search_mail_content/models/mail_thread.py @@ -44,7 +44,11 @@ class MailThread(models.AbstractModel): that inherits mail.thread """ res = super().get_view(view_id=view_id, view_type=view_type, options=options) - if view_type == "search" and self._fields.get("message_content"): + if ( + view_type == "search" + and self._fields.get("message_content") + and self.env.user.has_group("base.group_user") + ): doc = etree.XML(res["arch"]) for node in doc.xpath("/search/field[last()]"): # Add message_content in search view diff --git a/base_search_mail_content/readme/ROADMAP.md b/base_search_mail_content/readme/ROADMAP.md new file mode 100644 index 000000000..520a531ef --- /dev/null +++ b/base_search_mail_content/readme/ROADMAP.md @@ -0,0 +1 @@ +- This module restricts the message_content search functionality to internal users only, addressing the issue faced by project collaborators (portal users) as described in . Consequently, portal users no longer have the ability to search within mail content. diff --git a/base_search_mail_content/static/description/index.html b/base_search_mail_content/static/description/index.html index 4006c9be9..735c61392 100644 --- a/base_search_mail_content/static/description/index.html +++ b/base_search_mail_content/static/description/index.html @@ -390,11 +390,12 @@ body, email from, reply to and record name.