<?xml version="1.0" encoding="utf-8"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="https://www.omg.org/spec/DDS-SECURITY/20170901/omg_shared_ca_governance.xsd">
    <domain_access_rules>
        <domain_rule>
            <!-- No access control by any topic and participant is access protected -->
            <domains>
                <id>1</id>
            </domains>
            <allow_unauthenticated_participants>1</allow_unauthenticated_participants>
            <rtps_protection_kind>NONE</rtps_protection_kind>
            <discovery_protection_kind>SIGN</discovery_protection_kind>
            <liveliness_protection_kind>ENCRYPT</liveliness_protection_kind>
            <!--  Only and any authenticated DomainParticipant should be allowed to join the domain and
                  see the discovery data without checking access control  -->
            <enable_join_access_control>TRUE</enable_join_access_control>

            <topic_access_rules>
                <topic_rule>
                    <enable_liveliness_protection>FALSE</enable_liveliness_protection>
                    <data_protection_kind>ENCRYPT</data_protection_kind>
                    <enable_discovery_protection>TRUE</enable_discovery_protection>
                    <metadata_protection_kind>SIGN</metadata_protection_kind>
                    <topic_expression>Topic1</topic_expression>
                    <!-- The read access to all topics should be open to all. -->
                    <enable_read_access_control>true</enable_read_access_control>
                    <!-- The write access to all topics should be open to all. -->
                    <enable_write_access_control>true</enable_write_access_control>
                </topic_rule>
                <topic_rule>
                    <enable_liveliness_protection>FALSE</enable_liveliness_protection>
                    <data_protection_kind>ENCRYPT</data_protection_kind>
                    <enable_discovery_protection>TRUE</enable_discovery_protection>
                    <metadata_protection_kind>SIGN</metadata_protection_kind>
                    <topic_expression>Topic2</topic_expression>
                    <!-- The read access to all topics should be open to all. -->
                    <enable_read_access_control>true</enable_read_access_control>
                    <!-- The write access to all topics should be open to all. -->
                    <enable_write_access_control>true</enable_write_access_control>
                </topic_rule>
            </topic_access_rules>
        </domain_rule>
        <domain_rule>
            <!-- No write access control by one topic -->
            <domains>
                <id>2</id>
            </domains>
            <allow_unauthenticated_participants>1</allow_unauthenticated_participants>
            <rtps_protection_kind>NONE</rtps_protection_kind>
            <discovery_protection_kind>SIGN</discovery_protection_kind>
            <liveliness_protection_kind>ENCRYPT</liveliness_protection_kind>
            <!--  Only and any authenticated DomainParticipant should be allowed to join the domain and
                  see the discovery data without checking access control  -->
            <enable_join_access_control>TRUE</enable_join_access_control>

            <topic_access_rules>
                <topic_rule>
                    <enable_liveliness_protection>FALSE</enable_liveliness_protection>
                    <data_protection_kind>ENCRYPT</data_protection_kind>
                    <enable_discovery_protection>TRUE</enable_discovery_protection>
                    <metadata_protection_kind>SIGN</metadata_protection_kind>
                    <topic_expression>Topic1</topic_expression>
                    <!-- The read access to all topics should be open to all. -->
                    <enable_read_access_control>true</enable_read_access_control>
                    <!-- The write access to all topics should be open to all. -->
                    <enable_write_access_control>false</enable_write_access_control>
                </topic_rule>
                <topic_rule>
                    <enable_liveliness_protection>FALSE</enable_liveliness_protection>
                    <data_protection_kind>ENCRYPT</data_protection_kind>
                    <enable_discovery_protection>TRUE</enable_discovery_protection>
                    <metadata_protection_kind>SIGN</metadata_protection_kind>
                    <topic_expression>Topic2</topic_expression>
                    <!-- The read access to all topics should be open to all. -->
                    <enable_read_access_control>true</enable_read_access_control>
                    <!-- The write access to all topics should be open to all. -->
                    <enable_write_access_control>true</enable_write_access_control>
                </topic_rule>
            </topic_access_rules>
        </domain_rule> 
        <domain_rule>
            <!-- No write and read access control by all topic -->
            <domains>
                <id>3</id>
            </domains>
            <allow_unauthenticated_participants>1</allow_unauthenticated_participants>
            <rtps_protection_kind>NONE</rtps_protection_kind>
            <discovery_protection_kind>SIGN</discovery_protection_kind>
            <liveliness_protection_kind>ENCRYPT</liveliness_protection_kind>
            <!--  Only and any authenticated DomainParticipant should be allowed to join the domain and
                  see the discovery data without checking access control  -->
            <enable_join_access_control>TRUE</enable_join_access_control>

            <topic_access_rules>
                <topic_rule>
                    <enable_liveliness_protection>FALSE</enable_liveliness_protection>
                    <data_protection_kind>ENCRYPT</data_protection_kind>
                    <enable_discovery_protection>TRUE</enable_discovery_protection>
                    <metadata_protection_kind>SIGN</metadata_protection_kind>
                    <topic_expression>Topic1</topic_expression>
                    <!-- The read access to all topics should be open to all. -->
                    <enable_read_access_control>false</enable_read_access_control>
                    <!-- The write access to all topics should be open to all. -->
                    <enable_write_access_control>false</enable_write_access_control>
                </topic_rule>
                <topic_rule>
                    <enable_liveliness_protection>FALSE</enable_liveliness_protection>
                    <data_protection_kind>ENCRYPT</data_protection_kind>
                    <enable_discovery_protection>TRUE</enable_discovery_protection>
                    <metadata_protection_kind>SIGN</metadata_protection_kind>
                    <topic_expression>Topic2</topic_expression>
                    <!-- The read access to all topics should be open to all. -->
                    <enable_read_access_control>false</enable_read_access_control>
                    <!-- The write access to all topics should be open to all. -->
                    <enable_write_access_control>false</enable_write_access_control>
                </topic_rule>
            </topic_access_rules>
        </domain_rule>                  
        <domain_rule>
            <!-- Participant is access protected -->
            <domains>
                <id>4</id>
            </domains>
            <allow_unauthenticated_participants>1</allow_unauthenticated_participants>
            <rtps_protection_kind>NONE</rtps_protection_kind>
            <discovery_protection_kind>SIGN</discovery_protection_kind>
            <liveliness_protection_kind>ENCRYPT</liveliness_protection_kind>
            <!--  Only and any authenticated DomainParticipant should be allowed to join the domain and
                  see the discovery data without checking access control  -->
            <enable_join_access_control>FALSE</enable_join_access_control>

            <topic_access_rules>
                <topic_rule>
                    <enable_liveliness_protection>FALSE</enable_liveliness_protection>
                    <data_protection_kind>ENCRYPT</data_protection_kind>
                    <enable_discovery_protection>TRUE</enable_discovery_protection>
                    <metadata_protection_kind>SIGN</metadata_protection_kind>
                    <topic_expression>Topic1</topic_expression>
                    <!-- The read access to all topics should be open to all. -->
                    <enable_read_access_control>true</enable_read_access_control>
                    <!-- The write access to all topics should be open to all. -->
                    <enable_write_access_control>true</enable_write_access_control>
                </topic_rule>
            </topic_access_rules>
        </domain_rule>
    </domain_access_rules>
</dds>
