<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:five="http://namespaces.zope.org/five"
    xmlns:plone="http://namespaces.plone.org/plone"
    >

  <!-- Dexterity -->

  <plone:service
      method="GET"
      factory=".demo.Get"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="zope2.View"
      />

  <plone:service
      method="POST"
      factory=".demo.Post"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="cmf.AddPortalContent"
      />

  <plone:service
      method="PUT"
      factory=".demo.Put"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="cmf.ModifyPortalContent"
      />

  <plone:service
      method="DELETE"
      factory=".demo.Delete"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="zope2.DeleteObjects"
      />

  <plone:service
      method="PATCH"
      factory=".demo.Patch"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="cmf.ModifyPortalContent"
      />

  <plone:service
      method="OPTIONS"
      factory=".demo.Options"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="zope2.View"
      />

  <!-- Plone Site Root -->

  <plone:service
      method="GET"
      factory=".demo.Get"
      for="plone.base.interfaces.IPloneSiteRoot"
      permission="zope2.View"
      />

  <plone:service
      method="POST"
      factory=".demo.Post"
      for="plone.base.interfaces.IPloneSiteRoot"
      permission="cmf.AddPortalContent"
      />

  <plone:service
      method="PUT"
      factory=".demo.Put"
      for="plone.base.interfaces.IPloneSiteRoot"
      permission="cmf.ModifyPortalContent"
      />

  <plone:service
      method="DELETE"
      factory=".demo.Delete"
      for="plone.base.interfaces.IPloneSiteRoot"
      permission="zope2.DeleteObjects"
      />

  <plone:service
      method="PATCH"
      factory=".demo.Patch"
      for="plone.base.interfaces.IPloneSiteRoot"
      permission="cmf.ModifyPortalContent"
      />

  <plone:service
      method="OPTIONS"
      factory=".demo.Options"
      for="plone.base.interfaces.IPloneSiteRoot"
      permission="zope2.View"
      />

  <!-- Dexterity named services -->

  <plone:service
      method="GET"
      factory=".demo.NamedGet"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="zope2.View"
      name="namedservice"
      />

  <plone:service
      method="POST"
      factory=".demo.NamedPost"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="cmf.AddPortalContent"
      name="namedservice"
      />

  <plone:service
      method="PUT"
      factory=".demo.NamedPut"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="cmf.ModifyPortalContent"
      name="namedservice"
      />

  <plone:service
      method="DELETE"
      factory=".demo.NamedDelete"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="zope2.DeleteObjects"
      name="namedservice"
      />

  <plone:service
      method="PATCH"
      factory=".demo.NamedPatch"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="cmf.ModifyPortalContent"
      name="namedservice"
      />

  <plone:service
      method="OPTIONS"
      factory=".demo.NamedOptions"
      for="plone.dexterity.interfaces.IDexterityContent"
      permission="zope2.View"
      name="namedservice"
      />

  <plone:service
      method="GET"
      factory=".demo.NamedGet"
      for="*"
      permission="zope2.View"
      name="search"
      />

  <!-- Error Page -->

  <plone:service
      method="GET"
      factory=".testing.InternalServerErrorService"
      for="*"
      permission="zope2.View"
      name="500-internal-server-error"
      />

  <plone:CORSPolicy
      allow_origin="*"
      allow_methods="GET"
      expose_headers="X-My-Header"
      />

</configure>
