<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    i18n_domain="ploneintranet">

  <!-- this is secure but in a yukkie way

       The backend checks for api.user.get_current() which is great
       but the view permissions should be configured right also.
       This should be a custom permission instead of Zope2.View.
  -->

  <browser:page
      for="*"
      name="messaging-send"
      class=".messaging.MessageForm"
      template="send-message.pt"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

  <browser:page
      for="*"
      name="messaging-messages"
      class=".messaging.MessagingView"
      attribute="messages"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

  <browser:page
      for="*"
      name="delete-message"
      class=".messaging.MessagingView"
      attribute="delete_message"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

  <browser:page
      for="*"
      name="messaging-conversations"
      class=".messaging.MessagingView"
      attribute="conversations"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

  <browser:page
      for="*"
      name="social-inbox"
      class=".messaging.YourMessagesView"
      template="your-inbox.pt"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

    <browser:page
      for="*"
      name="delete-conversation"
      class=".messaging.MessagingView"
      attribute="delete_conversation"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

  <browser:page
      for="*"
      name="your-messages"
      class=".messaging.YourMessagesView"
      template="your-messages.pt"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

  <browser:viewlet
      name="ploneintranet.messaging.notifications"
      manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
      class=".viewlets.NotificationsViewlet"
      permission="zope2.View"
      layer=".interfaces.IPloneintranetMessagingLayer"
      />

</configure>
