<?xml version="1.0"?>
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:security="http://schooltool.org/securitypolicy"
    i18n_domain="schooltool">

  <class
      class="schooltool.relationship.relationship.BoundRelationshipProperty">
    <allow attributes="__iter__ __contains__ relationships" />
  </class>

  <class
      class="schooltool.relationship.relationship.RelationshipInfo">
    <allow attributes="source target extra_info" />
  </class>

  <adapter
      for="zope.annotation.interfaces.IAnnotatable"
      provides="schooltool.relationship.interfaces.IRelationshipLinks"
      factory="schooltool.relationship.annotatable.getRelationshipLinks"
      trusted="true"
      />

  <subscriber
      for="zope.lifecycleevent.interfaces.IObjectRemovedEvent"
      handler="schooltool.relationship.objectevents.unrelateOnDeletion"
      />

  <subscriber
      for="zope.lifecycleevent.interfaces.IObjectCopiedEvent"
      handler="schooltool.relationship.objectevents.unrelateOnCopy"
      />

  <configure
      xmlns="http://namespaces.zope.org/apidoc"
      xmlns:zcml="http://namespaces.zope.org/zcml"
      zcml:condition="have apidoc">
    <bookchapter
        id="relationships"
        title="Relationships"
        doc_path="README.txt"
        parent="schoolbell"
        />
  </configure>

  <security:allow
      interface="schooltool.relationship.interfaces.IRelationshipLink"
      crowds="administration owner"
      permission="schooltool.view" />
  <security:allow
      interface="schooltool.relationship.interfaces.IRelationshipLink"
      crowds="administration owner"
      permission="schooltool.edit" />

</configure>
