-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise-access-rules
27 lines (25 loc) · 1.18 KB
/
exercise-access-rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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>
</odoo>