Write Access rules to group depending on a field

I think i found a solution :slight_smile:
Thanks to all! Don’t hesitate to comment if this could be improved.

I seems working with this code:

...
        <record model="ir.rule.group" id="rule_group_product_not_validated">
           <field name="name">Product Not Validated</field>
		   <field name="model" search="[('model', '=', 'product.template')]"/>
		   <field name="global_p" eval="False"/>
		   <field name="default_p" eval="False"/>
		   <field name="perm_read" eval="False"/>
		   <field name="perm_write" eval="True"/>
		   <field name="perm_delete" eval="True"/>
       </record>
       <record model="ir.rule" id="rule_product_not_validated">
           <field name="domain" eval="[('validated', '=', False)]" pyson="1"/>
           <field name="rule_group" ref="rule_group_product_not_validated"/>
       </record>
       <record model="ir.rule.group-res.group"
           id="rule_group_product_not_validated_group_product_management">
           <field name="rule_group" ref="rule_group_product_not_validated"/>
           <field name="group" ref="group_product_management"/>
       </record>

        <record model="ir.rule.group" id="rule_group_product_admin_all_perm">
           <field name="name">Product All Perm Admin</field>
           <field name="model" search="[('model', '=', 'product.template')]"/>
	       <field name="global_p" eval="False"/>
	       <field name="default_p" eval="False"/>
           <field name="perm_read" eval="True"/>
           <field name="perm_write" eval="True"/>
           <field name="perm_create" eval="True"/>
           <field name="perm_delete" eval="True"/>
        </record>
       <record model="ir.rule.group-res.group"
           id="rule_group_product_admin_all_perm_group_product_admin">
           <field name="rule_group" ref="rule_group_product_admin_all_perm"/>
           <field name="group" ref="product.group_product_admin"/>
       </record>
...