Commit 11f32ffa authored by santi's avatar santi
Browse files

Security rules

parent 1f07c385
......@@ -12,6 +12,8 @@ Customization on the product model for FreedomCoop
'data': [
'views/partner_view.xml',
'views/report_invoice_custom.xml',
'security/record_rules.xml',
'security/ir.model.access.csv',
],
'installable': True,
'auto_install': False,
......
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_res_users_accountant","res_users accountant","base.model_res_users","account.group_account_user",1,1,0,0
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.rule" id="partner_createuid_rule">
<field name="name">Partner modify only created by user and own</field>
<field name="model_id" ref="model_res_partner"/>
<field name="global" eval="False"/>
<field name="domain_force">['|','|',('id','=',user.partner_id.id),('create_uid','=',False),('create_uid','=',user.id)]</field>
<field name="groups" eval="[(4,[ref('account.group_account_invoice')])]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
<record model="ir.rule" id="partner_write_accountant">
<field name="name">Partner write all accountants</field>
<field name="model_id" ref="model_res_partner"/>
<field name="global" eval="False"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,[ref('account.group_account_user')])]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
<record model="ir.rule" id="user_write_accountant">
<field name="name">User write all accountants</field>
<field name="model_id" ref="base.model_res_users"/>
<field name="global" eval="False"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,[ref('account.group_account_user')])]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
</data>
</openerp>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment