docker-odoo/16.0/extra-addons/openems/security/openems.xml
Arila Barnes 5594ca8d5d Added support for OpenEMS Odoo Add-ons
Signed-off-by: Arila Barnes <axmsoftware@Arilas-MacBook-Air-2.local>
2024-07-30 09:30:39 -07:00

55 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="module_category_openems" model="ir.module.category">
<field name="name">OpenEMS</field>
<field name="sequence">30</field>
</record>
<record id="group_openems_reader" model="res.groups">
<field name="name">Read access</field>
<field
name="comment"
>Members of this group have reading access to all devices</field>
<field name="category_id" ref="module_category_openems" />
</record>
<record id="group_openems_manager" model="res.groups">
<field name="name">Manager</field>
<field name="comment">Members of this group can manage all devices</field>
<field name="category_id" ref="module_category_openems" />
<field name="implied_ids" eval="[(4, ref('group_openems_reader'))]" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
<record id="openems_website_devices_portal" model="ir.rule">
<field
name="name"
>Website: Show only approved devices to Portal and User</field>
<field name="model_id" ref="model_openems_device" />
<field name="domain_force">['|', ('user_role_ids.user_id','in',[user.id]), ('alerting_settings.user_id','in',[user.id])]</field>
<field
name="groups"
eval="[(4, ref('base.group_portal')), (4, ref('base.group_user'))]"
/>
<field name="perm_read" eval="True" />
<field name="perm_write" eval="False" />
<field name="perm_create" eval="False" />
<field name="perm_unlink" eval="False" />
</record>
<record id="openems_website_devices_reader" model="ir.rule">
<field name="name">Website: Show all devices to readers group</field>
<field name="model_id" ref="model_openems_device" />
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4, ref('group_openems_reader'))]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="False" />
<field name="perm_create" eval="False" />
<field name="perm_unlink" eval="False" />
</record>
</odoo>