[FIX] mail: fix 504227cca9
Do not restrict followers-based alias to members of non public channels. Otherwise you may have issues defining a public mailing list with a subscription step. People still wouldn't be able to post on a public channel using a restricted alias.
This commit is contained in:
@@ -2219,7 +2219,7 @@ msgstr ""
|
||||
msgid "Policy to post a message on the document using the mailgateway.\n"
|
||||
"- everyone: everyone can post\n"
|
||||
"- partners: only authenticated partners\n"
|
||||
"- followers: only followers of the related document or members of following channels that are not public\n"
|
||||
"- followers: only followers of the related document or members of following channels\n"
|
||||
""
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class Alias(models.Model):
|
||||
help="Policy to post a message on the document using the mailgateway.\n"
|
||||
"- everyone: everyone can post\n"
|
||||
"- partners: only authenticated partners\n"
|
||||
"- followers: only followers of the related document or members of following channels that are not public\n")
|
||||
"- followers: only followers of the related document or members of following channels\n")
|
||||
|
||||
_sql_constraints = [
|
||||
('alias_unique', 'UNIQUE(alias_name)', 'Unfortunately this email alias is already used, please choose a unique one')
|
||||
|
||||
@@ -870,7 +870,7 @@ class MailThread(models.AbstractModel):
|
||||
obj = self.env[alias.alias_parent_model_id.model].browse(alias.alias_parent_thread_id)
|
||||
accepted_partner_ids = list(
|
||||
set(partner.id for partner in obj.message_partner_ids) |
|
||||
set(partner.id for channel in obj.message_channel_ids if channel.public != 'public' for partner in channel.channel_partner_ids)
|
||||
set(partner.id for channel in obj.message_channel_ids for partner in channel.channel_partner_ids)
|
||||
)
|
||||
if not author_id or author_id not in accepted_partner_ids:
|
||||
_warn('alias %s restricted to internal followers, skipping' % alias.alias_name)
|
||||
|
||||
Reference in New Issue
Block a user