flectra/doc/howtos/backend/exercise-access-rules

28 lines
1.2 KiB
Plaintext
Raw Normal View History

# HG changeset patch
# Parent 0602022dc2a428f9995c886df33b699b6d3bcb69
Index: addons/openacademy/security/security.xml
===================================================================
--- addons.orig/openacademy/security/security.xml 2014-08-26 17:26:18.971783090 +0200
+++ addons/openacademy/security/security.xml 2014-08-26 17:26:18.967783090 +0200
@@ -3,5 +3,19 @@
<record id="group_manager" model="res.groups">
<field name="name">OpenAcademy / Manager</field>
</record>
+
+ <record id="only_responsible_can_modify" model="ir.rule">
+ <field name="name">Only Responsible can modify Course</field>
+ <field name="model_id" ref="model_openacademy_course"/>
+ <field name="groups" eval="[(4, ref('openacademy.group_manager'))]"/>
+ <field name="perm_read" eval="0"/>
+ <field name="perm_write" eval="1"/>
+ <field name="perm_create" eval="0"/>
+ <field name="perm_unlink" eval="1"/>
+ <field name="domain_force">
+ ['|', ('responsible_id','=',False),
+ ('responsible_id','=',user.id)]
+ </field>
+ </record>
2018-03-14 10:18:18 +01:00
</flectra>