<!--
		SIF Implementation Specification (Australia) 1.1 (December 23, 2010) Infrastructure Version: 2.4-16
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.sifinfo.org/au/infrastructure/2.x" xmlns:sif="http://www.sifinfo.org/au/infrastructure/2.x" elementFormDefault="qualified">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="imports/xml/xml.xsd" />
  <xs:complexType name="SystemRoleType">
    <xs:annotation>
      <xs:documentation>
          The SystemRole Object defines the systems that a user has access to, the roles they perform within those systems, and the scope of those roles within the particular system.
        </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="SIF_RefId">
        <xs:complexType>
          <xs:annotation>
            <xs:documentation>The SIF RefId that provides the source Object for this SystemRole Object.</xs:documentation>
          </xs:annotation>
          <xs:simpleContent>
            <xs:extension base="sif:IdRefType">
              <xs:attribute name="SIF_RefObject" use="required">
                <xs:annotation>
                  <xs:documentation>The type of SIF object that the SIF_RefId attribute identifies.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:token">
                    <xs:enumeration value="Identity" />
                    <xs:enumeration value="StudentPersonal" />
                    <xs:enumeration value="StaffPersonal" />
                    <xs:enumeration value="StudentContactPersonal" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:attribute>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="SystemContextList">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="SystemContext" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="RoleList" minOccurs="0" nillable="true">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="Role" maxOccurs="unbounded">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="RoleScopeList" minOccurs="0" nillable="true">
                                <xs:complexType>
                                  <xs:sequence>
                                    <xs:element name="RoleScope" maxOccurs="unbounded">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element name="RoleScopeName" minOccurs="0" nillable="true" type="xs:normalizedString">
                                            <xs:annotation>
                                              <xs:documentation>The group/OU this role is applicable to.</xs:documentation>
                                            </xs:annotation>
                                          </xs:element>
                                          <xs:element name="RoleScopeRefId" minOccurs="0" nillable="true">
                                            <xs:complexType>
                                              <xs:annotation>
                                                <xs:documentation>The  SIF_RefId that provides  the source Object for this RoleScope.</xs:documentation>
                                              </xs:annotation>
                                              <xs:simpleContent>
                                                <xs:extension base="sif:IdRefType">
                                                  <xs:attribute name="SIF_RefObject" use="required">
                                                    <xs:annotation>
                                                      <xs:documentation>The type of SIF object that the SIF_RefId attribute identifies.</xs:documentation>
                                                    </xs:annotation>
                                                    <xs:simpleType>
                                                      <xs:restriction base="xs:token">
                                                        <xs:enumeration value="SchoolInfo" />
                                                        <xs:enumeration value="TeachingGroup" />
                                                        <xs:enumeration value="StudentActivityParticipation" />
                                                      </xs:restriction>
                                                    </xs:simpleType>
                                                  </xs:attribute>
                                                </xs:extension>
                                              </xs:simpleContent>
                                            </xs:complexType>
                                          </xs:element>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element>
                                  </xs:sequence>
                                </xs:complexType>
                              </xs:element>
                            </xs:sequence>
                            <xs:attribute name="RoleId" use="required" type="xs:normalizedString">
                              <xs:annotation>
                                <xs:documentation>Role of the entity this object describes in the SystemContext.</xs:documentation>
                              </xs:annotation>
                            </xs:attribute>
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
                <xs:attribute name="SystemId" use="required" />
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="SIF_Metadata" minOccurs="0" nillable="true" type="sif:SIF_MetadataType" />
      <xs:element name="SIF_ExtendedElements" minOccurs="0" nillable="true" type="sif:SIF_ExtendedElementsType">
        <xs:key name="SIF_ExtendedElementsKey3">
          <xs:selector xpath="./sif:SIF_ExtendedElement" />
          <xs:field xpath="@Name" />
        </xs:key>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="RefId" use="required" type="sif:RefIdType">
      <xs:annotation>
        <xs:documentation>The SIF RefId that uniquely identifies this object.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="SystemRole" type="sif:SystemRoleType">
    <xs:key name="SystemRoleKey1">
      <xs:selector xpath="." />
      <xs:field xpath="@RefId" />
    </xs:key>
  </xs:element>

</xs:schema>