Skip to content
Snippets Groups Projects
security.xml 1.41 KiB
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <!-- Groups -->

    <record id="group_messaging" model="res.groups">
        <field name="name">Messaging</field>
        <field name="category_id" ref="base.module_category_usability" />
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
        <field name="users" eval="[(4, ref('base.user_root'))]" />
    </record>

    <!-- Remove messaging menu for non messaging users -->

    <record id="mail.menu_root_discuss" model="ir.ui.menu">
        <field name="groups_id" eval="[(6, 0, [ref('group_messaging')])]" />
    </record>

    <record id="mail.access_discuss_channel_user" model="ir.model.access">
        <field name="active" eval="False" />
    </record>

    <record id="message_no_discuss_channel_access" model="ir.rule">
        <field name="name">No access to discuss messages to internal users</field>
        <field name="model_id" ref="mail.model_mail_message" />
        <field name="domain_force">[('model', '!=', 'discuss.channel')]</field>
        <field name="groups" eval="[(4, ref('base.group_user'))]" />
    </record>
    <record id="message" model="ir.rule">
        <field name="name">Only messaging users have access</field>
        <field name="model_id" ref="mail.model_mail_message" />
        <field name="domain_force">[(1, '=', 1)]</field>
        <field name="groups" eval="[(4, ref('group_messaging'))]" />
    </record>
</odoo>