Files
odoo_source/addons/mail_group/security/mail_group_security.xml
T
std-odoo 2d359b909b [ADD] mail_group: add a new module to manage the mailing lists
Purpose
=======

The purpose of this new module is to manage the mailing lists. Now they
are no more <mail.channel> (will email_send set to True) but they have
their own model.

Specifications
==============

The mailing list are basically a public discussion that users can have
by email. They can respond to email, send new messages, etc... All the
members of the mailing list will receive the message by email.

Users can moderate the emails of the mailing list in the same way as
they did with the "email" mail channel.
- *accept*, will accept the emails and send it to the members of the
  mailing list
- *discard*, will drop the email without warning the author
- *reject*, will drop the email and send a notification email to the
  author
- *allow*, will accept the email and all other pending emails of the
  same author and create a whitelist for him
- *ban* will drop the email and all other pending emails of the same
  author and create a blacklist for him

Now a portal view is available (in /groups) and replace the old module
"Website Mail Channel" that was removed in the previous commit. In this
view, users can subscribe / unsubscribe to the mailing lists and some
links to this portal view are added in the footer of the emails of the
mailing list.

As before with mail channels, you can send guidelines to the members,
notify the moderators whose an action is required (in a CRON), send back
an email to the author of an email to say "Your message is waiting
moderation"...

Links
=====

Task-2510267
See odoo/odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 12:32:28 +00:00

139 lines
7.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record id="mail_group_rule_all" model="ir.rule">
<field name="name">Mail Group: Access only public and joined groups</field>
<field name="model_id" ref="model_mail_group"/>
<field name="domain_force">[
'|',
'|',
'|',
('moderator_ids', 'in', user.id),
('access_mode', '=', 'public'),
'&amp;',
('access_mode', '=', 'groups'),
('access_group_id', 'in', [g.id for g in user.groups_id]),
'&amp;',
('access_mode', '=', 'members'),
('member_partner_ids', 'in', [user.partner_id.id]),
]
</field>
<field name="groups" eval="[(4, ref('base.group_user')), (4, ref('base.group_portal')), (4, ref('base.group_public'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_rule_administrator" model="ir.rule">
<field name="name">Mail Group: Administrator have access to all mail group</field>
<field name="model_id" ref="model_mail_group"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('mail_group.group_mail_group_manager'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_message_rule_public" model="ir.rule">
<field name="name">Mail Group Message: Only accepted message are accessible</field>
<field name="model_id" ref="model_mail_group_message"/>
<field name="domain_force">[
'&amp;',
('moderation_status', '=', 'accepted'),
'|',
'|',
'|',
('mail_group_id.moderator_ids', 'in', user.id),
('mail_group_id.access_mode', '=', 'public'),
'&amp;',
('mail_group_id.access_mode', '=', 'groups'),
('mail_group_id.access_group_id', 'in', [g.id for g in user.groups_id]),
'&amp;',
('mail_group_id.access_mode', '=', 'members'),
('mail_group_id.member_partner_ids', 'in', [user.partner_id.id]),
]
</field>
<field name="groups" eval="[(4, ref('base.group_public')), (4, ref('base.group_portal'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_message_rule_user" model="ir.rule">
<field name="name">Mail Group Message: Non-accepted messages are accessible only by moderators</field>
<field name="model_id" ref="model_mail_group_message"/>
<field name="domain_force">[
'&amp;',
'|',
('moderation_status', '=', 'accepted'),
('mail_group_id.moderator_ids', 'in', user.id),
'|',
'|',
'|',
('mail_group_id.moderator_ids', 'in', user.id),
('mail_group_id.access_mode', '=', 'public'),
'&amp;',
('mail_group_id.access_mode', '=', 'groups'),
('mail_group_id.access_group_id', 'in', [g.id for g in user.groups_id]),
'&amp;',
('mail_group_id.access_mode', '=', 'members'),
('mail_group_id.member_partner_ids', 'in', [user.partner_id.id]),
]
</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_message_rule_administrator" model="ir.rule">
<field name="name">Mail Group Message: Administrator have access to all messages</field>
<field name="model_id" ref="model_mail_group_message"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('mail_group.group_mail_group_manager'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_member_rule_user" model="ir.rule">
<field name="name">Mail Group Member: Members are accessible only by moderators</field>
<field name="model_id" ref="model_mail_group_member"/>
<field name="domain_force">[('mail_group_id.moderator_ids', 'in', user.id), ('mail_group_id.moderation', '=', True)]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_member_rule_administrator" model="ir.rule">
<field name="name">Mail Group Member: Administrator have access to all members</field>
<field name="model_id" ref="model_mail_group_member"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('mail_group.group_mail_group_manager'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_moderation_rule_user" model="ir.rule">
<field name="name">Mail Group Moderation: Moderation rules are accessible only by moderators</field>
<field name="model_id" ref="model_mail_group_moderation"/>
<field name="domain_force">[('mail_group_id.moderator_ids', 'in', user.id)]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="mail_group_moderation_rule_administrator" model="ir.rule">
<field name="name">Mail Group Moderation: Administrator have access to all moderation rules</field>
<field name="model_id" ref="model_mail_group_moderation"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('mail_group.group_mail_group_manager'))]"/>
<field name="perm_create" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
</odoo>