<?xml version="1.0" ?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://axelor.com/xml/ns/domain-models
  http://axelor.com/xml/ns/domain-models/domain-models_4.2.xsd">

  <module name="meta" package="com.axelor.meta.db" />

  <entity name="MetaPermission" table="META_PERMISSION">
    <string name="name" required="true" unique="true" />
    <string name="object" required="true" />
    <boolean name="active" default="true" />
    <one-to-many name="rules" ref="MetaPermissionRule" mappedBy="metaPermission" />
  </entity>

  <entity name="MetaPermissionRule" table="META_PERMISSION_RULE">
    <many-to-one name="metaPermission" ref="MetaPermission" required="true"/>
    <string name="field" required="true" />
    <boolean name="canRead" title="Read" />
    <boolean name="canWrite" title="Write" />
    <boolean name="canExport" title="Export" />
    <string name="readonlyIf" />
    <string name="hideIf" />
    <unique-constraint columns="metaPermission,field" />
  </entity>

</domain-models>
