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

  <setting
      key="everyone_can_view_person_list"
      text="Everyone can view the list of persons"
      default="False" />

  <setting
      key="everyone_can_view_person_info"
      text="Everyone can view info of persons"
      default="False" />

  <setting
      key="persons_can_set_their_preferences"
      text="Persons can set their own preferences"
      default="True" />

  <setting
      key="persons_can_change_their_passwords"
      text="Persons can change their own passwords"
      default="True" />

  <crowd
      name="person_list_viewers"
      factory=".person.PersonListViewersCrowd" />

  <crowd
      name="person_info_viewers"
      factory=".person.PersonInfoViewersCrowd" />

  <crowd
      name="person_prefs_editors"
      factory=".preference.PersonPreferencesEditorsCrowd" />

  <crowd
      name="person_password_writers"
      factory=".person.PasswordWriterCrowd" />

  <allow
      interface="schooltool.person.interfaces.IPersonContainer"
      crowds="administration person_list_viewers"
      permission="schooltool.view" />
  <allow
      interface="schooltool.person.interfaces.IPersonContainer"
      crowds="administration"
      permission="schooltool.edit" />

  <allow
      interface="schooltool.person.interfaces.IPerson"
      crowds="administration owner person_info_viewers"
      permission="schooltool.view" />
  <allow
      interface="schooltool.person.interfaces.IPerson"
      crowds="administration"
      permission="schooltool.edit" />
  <allow
      interface="schooltool.person.interfaces.IPerson"
      crowds="owner"
      permission="schooltool.editCalendarOverlays" />

  <zope:adapter
      factory=".person.PersonCalendarCrowd"
      provides="schooltool.app.interfaces.ICalendarParentCrowd"
      name="schooltool.view" />

  <allow
      interface="schooltool.person.interfaces.IPersonPreferences"
      crowds="administration owner"
      permission="schooltool.view" /> <!-- XXX -->
  <allow
      interface="schooltool.person.interfaces.IPersonPreferences"
      crowds="administration person_prefs_editors"
      permission="schooltool.edit" />

  <allow
      interface="schooltool.person.interfaces.IPasswordWriter"
      crowds="administration person_password_writers"
      permission="schooltool.edit" />

</configure>
