ir.rule records are in noupdate data blocks to let the admin alter them without fear of them being reset at next update. Other records such as groups are in normal mode, so they can be updated whenever necessary bzr revid: odo@openerp.com-20121218232001-t425t4hi7qbmsip2
43 lines
2.2 KiB
XML
43 lines
2.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data noupdate="1">
|
|
|
|
<!-- RULES -->
|
|
<record id="mail_group_public_and_joined" model="ir.rule">
|
|
<field name="name">Mail.group: access only public and joined groups</field>
|
|
<field name="model_id" ref="model_mail_group"/>
|
|
<!-- This rule has to be improved for employee only groups -->
|
|
<field name="domain_force">['|', '|', ('public', '=', 'public'), ('message_follower_ids', 'in', [user.partner_id.id]), '&', ('public','=','groups'), ('group_public_id','in', [g.id for g in user.groups_id])]</field>
|
|
</record>
|
|
|
|
<record id="mail_followers_read_write_own" model="ir.rule">
|
|
<field name="name">mail.followers: read and write its own entries</field>
|
|
<field name="model_id" ref="model_mail_followers"/>
|
|
<field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
|
|
<record id="mail_notification_read_write_own" model="ir.rule">
|
|
<field name="name">mail.notification: read and write its own entries</field>
|
|
<field name="model_id" ref="model_mail_notification"/>
|
|
<field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
|
|
<!--
|
|
This rule can not be uncommented, because we have a more wide method in mail.message. When we implement a many2one_variable field, we will be able to uncomment this.
|
|
<record id="mail_message_read_partner_or_author" model="ir.rule">
|
|
<field name="name">mail.message: read if notified or author</field>
|
|
<field name="model_id" ref="model_mail_message"/>
|
|
<field name="domain_force">['|', ('partner_ids', 'in', user.partner_id.id), ('author_id', '=', user.partner_id.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_write" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
-->
|
|
|
|
</data>
|
|
</openerp>
|