<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="rule_cx_tower_command_log_group_user_read" model="ir.rule">
        <field name="name">Tower command log: user access rule</field>
        <field name="model_id" ref="model_cx_tower_command_log" />
        <field name="groups" eval="[(4, ref('cetmix_tower_server.group_user'))]" />
        <field name="domain_force">[
                ("access_level", "=", "1"),
                ("create_uid", "=", user.id),
                ("server_id.user_ids", "in", [user.id])
        ]</field>
    </record>

    <record id="rule_cx_tower_command_log_group_manager_read" model="ir.rule">
        <field name="name">Tower command log: manager access rule</field>
        <field name="model_id" ref="model_cx_tower_command_log" />
        <field name="groups" eval="[(4, ref('cetmix_tower_server.group_manager'))]" />
        <field name="domain_force">[
            "&amp;",
                ("access_level", "&lt;=", "2"),
                "|",
                    ("server_id.user_ids", "in", [user.id]),
                    ("server_id.manager_ids", "in", [user.id])
        ]</field>
    </record>


    <record id="rule_cx_tower_command_log_group_root_full" model="ir.rule">
        <field name="name">Tower command log: root access rule</field>
        <field name="model_id" ref="model_cx_tower_command_log" />
        <field name="domain_force">[(1, "=", 1)]</field>
        <field name="groups" eval="[(4, ref('cetmix_tower_server.group_root'))]" />
    </record>
</odoo>
