Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2082 Näkymät

Version 12
I have defined an object called order. In my application, the user "order_entry" is supposed to have read and write rights for orders, for which he has been assigned (user_id = user.id) and which are in the state "draft". 
If he has not been assigned, he has read rights but no write rights for all orders in state "draft".

I defined an access_right for user "order_entry" in ir.model.access.csv (perm_read=1,perm_write=0) and then defined two records in security.xml, one for  <field name="domain_force">["&amp;",('state','=','draft'),('user_id','=', 'user.id')]</field> with <field name="perm_write" eval="1"/> and one record for domain_force (user_id != user.id) . 

When I run the code, the user has no write rights, even on orders, for which he is assigned. So  <field name="perm_write" eval="1"/> doesnt seem to work here.

Avatar
Hylkää
Paras vastaus

If the Order Entry user doesn't have "write" access to orders, then the Record Rule cannot override it.  So you need to grant read / write / create access first and then limit that with Record Rules.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
kesäk. 25
342
0
tammik. 25
1436
0
tammik. 25
1487
1
jouluk. 24
1971
0
toukok. 24
1538