<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <!-- Users can only see/manage their own calendar accounts -->
    <record id="fusion_calendar_account_user_rule" model="ir.rule">
        <field name="name">Users: own calendar accounts only</field>
        <field name="model_id" ref="model_fusion_calendar_account"/>
        <field name="domain_force">[('x_fc_user_id', '=', user.id)]</field>
        <field name="groups" eval="[(4, ref('base.group_user'))]"/>
    </record>

    <!-- Users can only see event links for their own events -->
    <record id="fusion_calendar_event_link_user_rule" model="ir.rule">
        <field name="name">Users: own event links only</field>
        <field name="model_id" ref="model_fusion_calendar_event_link"/>
        <field name="domain_force">[('x_fc_account_id.x_fc_user_id', '=', user.id)]</field>
        <field name="groups" eval="[(4, ref('base.group_user'))]"/>
    </record>

</odoo>
