[IMP] mail.followers: users can now read their own subscriptions.
authorThibault Delavallée <tde@openerp.com>
Mon, 15 Oct 2012 15:11:27 +0000 (17:11 +0200)
committerThibault Delavallée <tde@openerp.com>
Mon, 15 Oct 2012 15:11:27 +0000 (17:11 +0200)
bzr revid: tde@openerp.com-20121015151127-5abtwg8uraj0du0u

addons/mail/security/ir.model.access.csv
addons/mail/security/mail_security.xml

index b68a9ab..c609667 100644 (file)
@@ -3,7 +3,7 @@ access_mail_message_all,mail.message.all,model_mail_message,,1,0,1,0
 access_mail_message_group_user,mail.message.group.user,model_mail_message,base.group_user,1,1,1,1\r
 access_mail_mail_all,mail.mail.all,model_mail_mail,,0,0,1,0\r
 access_mail_mail_system,mail.mail.system,model_mail_mail,base.group_system,1,1,1,1\r
-access_mail_followers_all,mail.followers.all,model_mail_followers,,0,0,0,0\r
+access_mail_followers_all,mail.followers.all,model_mail_followers,,1,0,0,0\r
 access_mail_followers_system,mail.followers.system,model_mail_followers,base.group_system,1,1,1,1\r
 access_mail_notification_all,mail.notification.all,model_mail_notification,,1,0,0,0\r
 access_mail_notification_aystem,mail.notification.system,model_mail_notification,base.group_system,1,1,1,1\r
index be3bb66..c8d37f3 100644 (file)
@@ -3,13 +3,22 @@
     <data>
 
         <!-- RULES -->
-        <record id="group_rule_public_and_joined" model="ir.rule">
+        <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]), '&amp;', ('public','=','groups'), ('group_public_id','in', [g.id for g in user.groups_id])]</field>
         </record>
 
+        <record id="mail_followers_read_own" model="ir.rule">
+            <field name="name">mail.followers: read its own entries</field>
+            <field name="model_id" ref="model_mail_followers"/>
+            <!-- This rule has to be improved for employee only groups -->
+            <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.