<?xml version="1.0"?>
<!DOCTYPE policy SYSTEM "policy.dtd" >
<policy>
<!-- ===================================================
  1. The chairperson and the committee members can read 
     the review document (unless a policy explicitly 
     specifies denial.)
 =================================================== -->
  <xacl>
    <object href="/review_summary"/>
    <rule>
      <acl>
        <subject>
          <group>chair</group>
        </subject>
        <subject>
          <group>committee</group>
        </subject>
        <action name="read" permission="grant"/>
      </acl>
    </rule>
  </xacl>
<!-- ===================================================
  2. The chairperson can write the result (accept or 
     reject) in the result field.
 =================================================== -->
  <xacl>
    <object href="/review_summary/entry/result"/>
    <rule>
      <acl>
        <subject>
          <group>chair</group>
        </subject>
        <action name="write" permission="grant"/>
      </acl>
    </rule>
<!-- ===================================================
   3. Authors cannot read the result of their own 
      submission until the notification date comes.
 =================================================== -->
    <rule>
      <acl>
        <subject>
          <group>author</group>
        </subject>
        <action name="read" permission="deny"/>
        <condition operation="or">
          <predicate name="compareStr">
            <parameter>neq</parameter>
            <parameter><function name="getValue"><parameter>../author</parameter></function></parameter>
            <parameter><function name="getUid"/></parameter>
          </predicate>
          <predicate name="compareDate">
            <parameter>before</parameter>
            <parameter><function name="getDate"/></parameter>
            <parameter><function name="getValue"><parameter>/review_summary/notification_date</parameter></function></parameter>
          </predicate>
        </condition>
      </acl>
    </rule>
<!-- ===================================================
   4. Authors can read the result of their own 
      submission provided the confirmation field
      is updated with "checked"
 =================================================== -->
    <rule>
      <acl>
        <subject>
          <group>author</group>
        </subject>
        <action name="read" permission="grant">
          <provisional_action name="write" timing="before">
            <parameter>../confirmation</parameter>
            <parameter>checked</parameter>
          </provisional_action>
        </action>
        <condition operation="and">
          <predicate name="compareStr">
            <parameter>eq</parameter>
            <parameter><function name="getValue"><parameter>../author</parameter></function></parameter>
            <parameter><function name="getUid"/></parameter>
          </predicate>
          <predicate name="compareDate">
            <parameter>after</parameter>
            <parameter><function name="getDate"/></parameter>
            <parameter><function name="getValue"><parameter>/review_summary/notification_date</parameter></function></parameter>
          </predicate>
        </condition>
      </acl>
    </rule>
  </xacl>
<!-- ===================================================
  5. Authors can read the their own submission entry.
 =================================================== -->
  <xacl>
    <object href="/review_summary/entry"/>
    <rule>
      <acl>
        <subject>
          <group>author</group>
        </subject>
        <action name="read" permission="grant"/>
        <condition operation="and">
          <predicate name="compareStr">
            <parameter>eq</parameter>
            <parameter><function name="getValue"><parameter>./author</parameter></function></parameter>
            <parameter><function name="getUid"/></parameter>
          </predicate>
        </condition>
      </acl>
    </rule>
  </xacl>
<!-- ===================================================
  6. For anonymity purpose, the committee members and 
     reviewers cannot read the authors' names.
 =================================================== -->
  <xacl>
    <object href="/review_summary/entry/author"/>
    <rule>
      <acl>
        <subject>
          <group>committee</group>
        </subject>
        <subject>
          <group>reviewer</group>
        </subject>
        <action name="read" permission="deny"/>
      </acl>
    </rule>
  </xacl>
<!-- ===================================================
  7. For anonymity purpose, the committee members cannot 
     read the reviewers' names except for the case that 
     the request initiator's name is same as the 
     reviewer's name.
 =================================================== -->
  <xacl>
    <object href="/review_summary/entry/review/reviewer"/>
    <rule>
      <acl>
        <subject>
          <group>committee</group>
        </subject>
        <action name="read" permission="deny"/>
        <condition operation="and">
          <predicate name="compareStr">
            <parameter>neq</parameter>
            <parameter><function name="getValue"><parameter>.</parameter></function></parameter>
            <parameter><function name="getUid"/></parameter>
          </predicate>
        </condition>
      </acl>
    </rule>
  </xacl>
<!-- ===================================================
  8. Authors cannot read reviewers' evaluations.
 =================================================== -->
  <xacl>
    <object href="/review_summary/entry/review"/>
    <rule>
      <acl>
        <subject>
          <group>author</group>
        </subject>
        <action name="read" permission="deny"/>
      </acl>
    </rule>
<!-- ===================================================
  9. Reviewers can read and write the review fields 
     only for papers assigned to them.
 =================================================== -->
    <rule>
      <acl>
        <subject>
          <group>reviewer</group>
        </subject>
        <action name="read" permission="grant"/>
        <action name="write" permission="grant"/>
        <condition operation="and">
          <predicate name="compareStr">
            <parameter>eq</parameter>
            <parameter><function name="getValue"><parameter>./reviewer</parameter></function></parameter>
            <parameter><function name="getUid"/></parameter>
          </predicate>
        </condition>
      </acl>
    </rule>
  </xacl>
<!-- ===================================================
  10. Reviewers can read titles and numbers of papers 
      assigned to them.
 =================================================== -->
  <xacl>
    <object href="/review_summary/entry/paper_title"/>
    <object href="/review_summary/entry/paper_number"/>
    <rule>
      <acl>
        <subject>
          <group>reviewer</group>
        </subject>
        <action name="read" permission="grant"/>
        <condition operation="and">
          <predicate name="compareStr">
            <parameter>eq</parameter>
            <parameter><function name="getValue"><parameter>../review/reviewer</parameter></function></parameter>
            <parameter><function name="getUid"/></parameter>
          </predicate>
        </condition>
      </acl>
    </rule>
  </xacl>
</policy>
