<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="DynamicPortfolio" version="1">

    <description>A Dynamic VDB</description>
    
    <property name="UseConnectorMetadata" value="true" />

    <model name="MarketData">
        <source name="text-connector" translator-name="file" connection-jndi-name="java:/marketdata-file"/>
    </model>

    <model name="Accounts">
        <property name="importer.useFullSchemaName" value="false"/>
        <source name="hsql-connector" translator-name="hsql" connection-jndi-name="java:/accounts-ds"/>
    </model>
    
    <!-- For detailed description about data roles please refer to Reference Guide's Data Roles chapter -->
    <data-role name="ReadOnly" any-authenticated="true">
        <description>Allow ReadOnly Operations by default to any authenticated user</description>

        <permission>
            <resource-name>Accounts</resource-name>
            <allow-create>false</allow-create>
            <allow-read>true</allow-read>
            <allow-update>false</allow-update>
        </permission>
        
        <permission>
            <resource-name>MarketData</resource-name>
            <allow-create>false</allow-create>
            <allow-read>true</allow-read>
            <allow-update>false</allow-update>
        </permission>
        
        <!-- 
            Since any-authenticated is set to true above, any user who has login credentials to access the VDB
            will be given this role. No explicit mapping to a JAAS role is not needed.
        -->
        <mapped-role-name>anyuser</mapped-role-name>
    </data-role>
    
    <data-role name="ReadWrite">
        <description>Allow Reads and Writes to tables and procedures</description>

        <permission>
            <resource-name>Accounts</resource-name>
            <allow-create>false</allow-create>
            <allow-read>true</allow-read>
            <allow-update>true</allow-update>
        </permission>
        
        <permission>
            <resource-name>MarketData</resource-name>
            <allow-create>false</allow-create>
            <allow-read>true</allow-read>
            <allow-update>true</allow-update>
        </permission>
        
        <!--
            This role must defined in the JAAS security domain, the sample UserRolesLoginModules based roles file provided 
            in this sample directory. copy these "teiid-security-roles.properties" and "teiid-security-users.proeprties" 
            into "<jboss-install>/modules/org/jboss/teiid/conf" directory and replace the old ones.
        -->
        <mapped-role-name>supervisor</mapped-role-name>
    </data-role>    
    
    

</vdb>