diff options
| author | Thibault Delavallée <tde@openerp.com> | 2014-02-19 12:13:30 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2014-02-19 12:13:30 +0100 |
| commit | f9993774f1ebe197fb72cce66a209c902d3dd9dd (patch) | |
| tree | 05c332f1c423e0213f1d55dfce3bd2355edabdc0 /addons/note/security | |
| parent | fbead8fab1e909df393c002ad1954f0848443385 (diff) | |
[IMP] note: user_id owner field added in model, allowing to tune a bit
the access rules, notably about reading and creation. This allows by the way
to remove the hack about the operation in context when subscribing
users on a document.
The new rules on create and read now include user_id, aka the owner of a note
can always create (default value) and read its notes.
Also removed an unnecessary field (current_partner_id), as it was buggy and
unnecessary; view udpated accordingly.
[IMP] mail: removed a hack introduced in saas-3 with the current orm operation
in context to by-pass some access rules when subscribing someone on a document.
bzr revid: tde@openerp.com-20140219111330-l3hw5324hvuikpjc
Diffstat (limited to 'addons/note/security')
| -rw-r--r-- | addons/note/security/ir.rule.xml | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/addons/note/security/ir.rule.xml b/addons/note/security/ir.rule.xml index 2c6e9f3bc7f..2b9645cc9d4 100644 --- a/addons/note/security/ir.rule.xml +++ b/addons/note/security/ir.rule.xml @@ -1,23 +1,30 @@ <?xml version="1.0"?> <openerp> <data> - <record id="note_note_rule_global" model="ir.rule"> - <field name="name">Only followers can access a sticky notes</field> - <field ref="model_note_note" name="model_id"/> - <field name="domain_force">[('message_follower_ids','=',user.partner_id.id)]</field> - <field eval="True" name="global"/> - <field eval="1" name="perm_unlink"/> - <field eval="0" name="perm_write"/> - <field eval="1" name="perm_read"/> - <field eval="0" name="perm_create"/> - </record> + <record id="note_note_rule_global" model="ir.rule"> + <field name="name">Only followers can access a sticky notes</field> + <field name="model_id" ref="model_note_note"/> + <field name="domain_force">['|', ('user_id', '=', user.id), ('message_follower_ids', '=', user.partner_id.id)]</field> + <field name="global" eval="True"/> + <field name="perm_create" eval="False"/> + <field name="perm_unlink" eval="False"/> + </record> + + <record id="note_note_create_unlink_global" model="ir.rule"> + <field name="name">note: create / unlink: responsible</field> + <field name="model_id" ref="model_note_note"/> + <field name="domain_force">[('user_id', '=', user.id)]</field> + <field name="global" eval="True"/> + <field name="perm_write" eval="False"/> + <field name="perm_read" eval="False"/> + </record> + + <record id="note_stage_rule_global" model="ir.rule"> + <field name="name">Each user have his stage name</field> + <field name="model_id" ref="model_note_stage"/> + <field name="domain_force">['|',('user_id','=',False),('user_id','=',user.id)]</field> + <field name="global" eval="True"/> + </record> - <record id="note_stage_rule_global" model="ir.rule"> - <field name="name">Each user have his stage name</field> - <field ref="model_note_stage" name="model_id"/> - <field name="domain_force">['|',('user_id','=',False),('user_id','=',user.id)]</field> - <field eval="True" name="global"/> - </record> </data> </openerp> - |
