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

  <setting
      key="instructors_can_schedule_sections"
      text="Instructors can schedule their own sections."
      alt_text="Only clerks can schedule sections."
      default="False" />

  <crowd
      name="configurable_instructors_can_schedule"
      factory=".app.ConfigurableScheduleEditors" />

  <allow
      interface="schooltool.timetable.interfaces.ITimetableContainer"
      crowds="everybody"
      permission="schooltool.view" />
  <allow
      interface="schooltool.timetable.interfaces.ITimetableContainer"
      crowds="managers"
      permission="schooltool.edit" />

  <crowd
      name="schedule_viewers"
      factory=".app.ScheduleViewersCrowd" />

  <zope:adapter
      trusted="yes"
      factory=".app.SectionScheduleViewers"
      provides="schooltool.timetable.interfaces.IScheduleParentCrowd"
      name="schooltool.view" />

  <crowd
      name="schedule_editors"
      factory=".app.ScheduleEditorsCrowd" />

  <zope:adapter
      trusted="yes"
      factory=".app.SectionScheduleEditors"
      provides="schooltool.timetable.interfaces.IScheduleParentCrowd"
      name="schooltool.edit" />

  <allow
      interface="schooltool.timetable.interfaces.IScheduleContainer"
      crowds="managers clerks schedule_viewers"
      permission="schooltool.view" />

  <allow
      interface="schooltool.timetable.interfaces.IScheduleContainer"
      crowds="clerks schedule_editors"
      permission="schooltool.edit" />

  <!-- Security descriptions -->

  <describe_group name="schooltool.timetable" title="School timetables" />

  <describe_action
     group="schooltool.timetable" name="list" title="List/Search"
     order="10"
     interface="schooltool.timetable.interfaces.ITimetableContainer"
     permission="schooltool.view"
  />

  <describe_action
     group="schooltool.timetable" name="create_delete" title="Create/Delete"
     order="20"
     interface="schooltool.timetable.interfaces.ITimetableContainer"
     permission="schooltool.edit"
  />

  <describe_action
     group="schooltool.timetable" name="view" title="View"
     order="30"
     interface="schooltool.timetable.interfaces.ITimetableContainer"
     permission="schooltool.view"
  />

  <describe_action
     group="schooltool.timetable" name="modify" title="Modify"
     order="40"
     interface="schooltool.timetable.interfaces.ITimetableContainer"
     permission="schooltool.edit"
  />

</configure>
