~humbertoarocha/+junk/oa_val

« back to all changes in this revision

Viewing changes to openacademy/security/groups.xml

  • Committer: Humberto Arocha
  • Date: 2013-03-22 14:12:38 UTC
  • Revision ID: humbertoarocha@gmail.com-20130322141238-ec13vku86k97cmbg
Exercise 4 - Record rule
Add a record rule for the model Course and the group “OpenAcademy / Manager”,
that restricts “write” and “unlink” accesses to the responsible of a course. If
a course has no responsible, all users of the group must be able to modify it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
            <field name="name">OpenAcademy / Manager</field>
11
11
        </record>
12
12
    </data>
 
13
    <data>
 
14
        <record id="only_responsible_can_modify" model="ir.rule">
 
15
            <field name="name">Only Responsible can modify Course</field>
 
16
            <field name="model_id" ref="model_openacademy_course"/>
 
17
            <field name="groups" eval="[(4, ref('openacademy.group_manager'))]"/>
 
18
            <field name="perm_read" eval="0"/>
 
19
            <field name="perm_write" eval="1"/>
 
20
            <field name="perm_create" eval="0"/>
 
21
            <field name="perm_unlink" eval="1"/>
 
22
            <field name="domain_force">['|', ('responsible_id','=',False), ('responsible_id','=',user.id)]</field>
 
23
        </record>
 
24
    </data>
13
25
</openerp>