<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [
<!ENTITY rfc2119 PUBLIC '' 'bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc3744 PUBLIC '' 'bibxml/reference.RFC.3744.xml'>
<!ENTITY rfc4791 PUBLIC '' 'bibxml/reference.RFC.4791.xml'>
<!ENTITY rfc4918 PUBLIC '' 'bibxml/reference.RFC.4918.xml'>
<!ENTITY rfc6352 PUBLIC '' 'bibxml/reference.RFC.6352.xml'>
<!ENTITY rfc7303 PUBLIC '' 'bibxml/reference.RFC.7303.xml'>
]>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc strict="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc ipr="trust200902" docName='draft-pot-webdav-resource-sharing-02'>
    <front>
        <title abbrev="WebDAV Resource Sharing">WebDAV Resource Sharing</title>
        <author initials="E." surname="Pot" fullname="Evert Pot">
            <organization abbrev="fruux GmbH">
                fruux GmbH
            </organization>
            <address>
                <postal>
                    <street>Koenigsstrasse 32</street>
                    <city>Muenster</city>
                    <region>NRW</region>
                    <code>48143</code>
                    <country>Germany</country>
                </postal>
                <email>me@evertpot.com</email>
                <uri>https://fruux.com/</uri>
            </address>
        </author>
        <author initials="C." surname="Daboo" fullname="Cyrus Daboo">
            <organization abbrev="Apple Inc.">
                Apple Inc.
            </organization>
            <address>
                <postal>
                    <street>1 Infinite Loop</street>
                    <city>Cupertino</city>
                    <region>CA</region>
                    <code>95014</code>
                    <country>USA</country>
                </postal>
                <email>cyrus@daboo.name</email>
                <uri>http://www.apple.com/</uri>
            </address>
        </author>
        <author initials="E." surname="York" fullname="Eric York">
            <organization abbrev="Apple Inc.">
                Apple Inc.
            </organization>
            <address>
                <postal>
                    <street>1 Infinite Loop</street>
                    <city>Cupertino</city>
                    <region>CA</region>
                    <code>95014</code>
                    <country>USA</country>
                </postal>
                <email></email>
                <uri>http://www.apple.com/</uri>
            </address>
        </author>
        <date/>
        <abstract>
            <t>
                This specification defines an extension to WebDAV that enables the sharing of
                resources between users on a WebDAV server.
            </t>
        </abstract>
    </front>
    <middle>
        <section title='Introduction'>

            <t>
                Users of <xref target="RFC4791">CalDAV</xref> and
                <xref target="RFC6352">CardDAV</xref> often require a
                mechanism to share a calendar or address book collection
                with other users.
            </t>
            <t>
                This specification introduces a mechanism that allows
                users of WebDAV servers to invite another user to share a
                resource or WebDAV collection. The invited user can either
                accept or reject the invite, which is communicated back to the
                sharer. If the user chooses to accept the invite, the shared
                resource will then appear in a location on the server that's
                accessible by the invitee.
            </t>
            <t>
                There are existing mechanism that address similar use-cases,
                such as using <xref target='RFC3744'>WebDAV ACL</xref> for
                fine-grained access control. Experiences has shown that client
                developers are averse to using it due its complexity. Many
                implementations have chosen to only use WebDAV ACL for
                communicating access control information to clients, but not
                for modification. WebDAV ACL alone also does not provide the
                means for a user to invite another user.
            </t>
            <t>
                HTTP POST operations are used to manage the sharing invitations
                and replies, and WebDAV properties are used to expose the state
                of shared resources.
            </t>
            <t>
                This specification uses WebDAV notifications to communicate to
                users there are outstanding invitations, or responses to
                invitations.
            </t>
        </section>

        <section title='Conventions Used in This Document'>
            <t>
                The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target='RFC2119' />.
            </t>
            <t>
                When XML element types in the namespaces "DAV:" and "urn:ietf:params:xml:ns:caldav" are referenced in this document outside of the context of an XML fragment, the string "DAV:" and "CALDAV:" will be prefixed to the element type names respectively.
            </t>
            <t>Terms Used:
                <list style='hanging'>
                    <t hangText='Sharer'>A user who is sharing a resource with other users.</t>
                    <t hangText='Sharee'>A user to whom a resource has been shared.</t>
                    <t hangText='Sharing Invite'>A message sent by a sharer to a sharee to indicate the status of a shared resource.</t>
                    <t hangText='Sharing Reply'>A message sent by a sharee to a sharer to indicate the status of a shared resource.</t>
                </list>
            </t>
            <t>
              The DTD samples used in this document are for illustrative
              purposes only. The conventions and restrictions described in
              <xref target="RFC4918" /> section 17.
            </t>
        </section>

        <section title='Overview' anchor='overview'>
            <t>
                This section provides a basic overview of this protocol by way
                of a simple use case of a sharer sharing a collection with a
                single sharee.
            </t>
            <t>
                To share a resource with another user, the sharer's client
                executes an HTTP POST request against the resource that's to
                be shared. The POST request body will contain details of the
                user to whom the resource is to be shared as well as the
                access right to be granted to them. If the request succeeds, a
                notification is sent to the sharee with details of the
                resource being shared to them.
            </t>
            <t>
                The sharer's client will show the notification to the sharee
                and present them with the choice to accept or decline the
                invitation to the shared collection. If the sharee chooses to
                decline, then nothing changes for that sharee. If the sharee
                chooses to accept, then a new resource is created at a
                location that's accessible to the sharee.
                The server enforces the appropriate access privileges for the
                sharee.
            </t>
            <t>
                At any time, the sharer can inspect properties on the
                resource being shared, and determine the accept/decline
                status of each sharee. Additional sharees can be added and
                existing ones removed. The access privileges for existing
                sharees can also be changed.
            </t>
            <t>
                Once a sharee has access to the shared resource, they can
                remove it and decline the sharing invite by simply having
                their client issue an HTTP DELETE request on the shared
                collection. That does not delete any data, but rather simply
                removes the "link" to the sharer's resource and sets the
                sharee's invite status to declined.
            </t>
        </section>

        <section title="Notification Definitions">
            <t>
                In order to facilitate the process of sharing invitations, this
                specification uses <!-- <xref target="dav-notifications">-->WebDAV
                notifications<!-- </xref> -->, and defines several new notification
                types.
            </t>
            <section title="Invite Notification" anchor='invite-notification'>
                <t>
                    When a sharer adds a new sharee to a resource, or updates
                    a sharee, an invite notification is added to the sharee's
                    notification collection.
                </t>
                <t>
                    The notification contains information about the shared
                    resource, the owner and how to respond to the invitation.
                </t>
                <section title="Example: An invite notification">
                    <t>
                        This is an example of a response to a GET request on a
                        correct invite notification. Note that several HTTP
                        response headers have been removed for brevity.
                    </t>
                    <t>
                    <figure>
                        <artwork><![CDATA[
HTTP/1.1 200 OK
Content-Type: application/davnotification+xml
Content-Length: xxxx

<D:notification xmlns:D="DAV:">
    <D:dtstamp>2014-08-05T13:38:02Z</D:dtstamp>
    <D:invite-notification>
        <D:principal>
            <D:href>/principals/users/evert/</D:href>
        </D:principal>
        <D:invite-accepted />
        <D:href>/calendars/users/evert/offdays/</D:href>
        <D:access><D:read-write /></D:access>
        <D:prop>
            <D:displayname>Vacation days!!</D:displayname>
            <D:resourcetype><D:collection /></D:resourcetype>
        </D:prop>
    </D:invite-notification>
</D:notification>
]]></artwork>
                    </figure>
                    </t>
                </section>
            </section>
            <section title="Invite Reply" anchor='reply-notification'>
                <t>
                    After a sharee has accepted or declined an invitation,
                    the sharer receives a reply-notification in their notification
                    collection.
                </t>
                <t>
                    This notification contains information about which
                    collection this relates to, and who responded to the
                    invite.
                </t>
                <section title="Example: An invite reply">
                    <t>
                        This is an example of a response to a GET request on a
                        correct invite notification. Note that several HTTP
                        response headers have been removed for brevity.
                    </t>
                    <t>
                    <figure>
                        <artwork><![CDATA[
HTTP/1.1 200 OK
Content-Type: application/davnotification+xml
Content-Length: xxxx

<D:notification xmlns:D="DAV:">
    <D:dtstamp>2014-09-03T02:30:00Z</D:dtstamp>
    <D:reply-notification>
        <D:principal>
            <D:href>mailto:john@example.org</D:href>
        </D:principal>
        <D:invite-declined />
        <D:href>/calendars/users/evert/offdays/</D:href>
        <D:comment>Sorry, I'm not interested</D:comment>
    </D:reply-notification>
</D:notification>
]]></artwork>
                    </figure>
                    </t>
                </section>
            </section>
        </section>

        <section title="Resource sharing">
            <section title="Feature Discovery">
                <t>
                  A server that supports the features described in this
                  document MUST include "resource-sharing" as a field in the
                  DAV response header from an OPTIONS request on any resource
                  that supports these features.
                </t>
            </section>
            <section title="Additional Properties for resources" anchor='properties'>
                <t>
                    The following new or modified WebDAV properties are defined for resources and used to view or manipulate shared resources features.
                </t>
                <section title="DAV:share-mode Property" anchor="DAV:resourcetype">
                    <t>
                      Resources that are shared must have a DAV:share-mode property. It's value
                      should be one of two elements:
                        <list style="symbols">
                            <t><xref target="DAV:shared-owner">DAV:shared-owner</xref>: used to indicate that the resource is owned by the current user and is being shared by them.</t>
                            <t><xref target="DAV:shared">DAV:shared</xref>: used to indicate that the resource is owned by another user and is being shared to the current user.</t>
                        </list>
                    </t>
                </section>
                <section title="DAV:invite Property" anchor="DAV:invite">
                  <t>
                    <list style="hanging">
                      <t hangText="Name:">invite</t>
                      <t hangText="Namespace:">DAV:</t>
                      <t hangText="Purpose:">Used to show to whom a resource has been shared.</t>
                      <t hangText="Protected:">This property MUST be protected.</t>
                      <t hangText="PROPFIND behavior:">This property SHOULD NOT be returned by a PROPFIND allprop request (as defined in Section 14.2 of <xref target="RFC4918"/>).</t>
                      <t hangText="COPY/MOVE behavior:">This property value MUST be preserved in MOVE operations, but MUST NOT be preserved in COPY operations.</t>

                      <t hangText="Description:">
                          This WebDAV property is present on a resource that
                          has been shared by the owner, or on the resources for
                          the sharees. It provides a list of users to whom the
                          resource has been shared, along with the "status" of
                          the sharing invites sent to each user. In addition,
                          servers SHOULD include a DAV:principal XML element on
                          resources of the sharees to provide clients with a
                          fast way to determine who the sharer is. A server's
                          local privacy policy may prevent sharees from
                          knowing about other sharees on a shared calendar.
                          If that is so server will not include DAV:user XML
                          elements for other sharees.
                      </t>
                      <t hangText="Definition:">
                        <figure>
                          <artwork><![CDATA[
<!ELEMENT invite (organizer?, user*)>]]></artwork>
                        </figure>
                      </t>
                    </list>
                  </t>
                </section>
                <section title="DAV:sharer-resource-url Property" anchor="DAV:sharer-resource-url">
                  <t>
                    <list style="hanging">
                      <t hangText="Name:">sharer-resource-url</t>
                      <t hangText="Namespace:">DAV:</t>
                      <t hangText="Purpose:">Indicates the URL of the owner's copy of a shared resource.</t>
                      <t hangText="Protected:">This property MUST be protected.</t>
                      <t hangText="PROPFIND behavior:">This property SHOULD NOT be returned by a PROPFIND allprop request (as defined in Section 14.2 of <xref target="RFC4918"/>).</t>
                      <t hangText="COPY/MOVE behavior:">This property value MUST be preserved in COPY and MOVE operations.</t>

                      <t hangText="Description:">
                          This WebDAV property MAY be present on a shared
                          resource. Its content is a single DAV:href element
                          whose value is the URL of the sharer's resource being
                          shared.
                      </t>
                      <t hangText="Definition:">
                        <figure>
                          <artwork><![CDATA[
<!ELEMENT sharer-resource-url (DAV:href)>]]></artwork>
                        </figure>
                      </t>
                    </list>
                  </t>
                </section>
            </section>
            <section title="Sharer Actions on Shared Resource">
                <section title="Sharing or Unsharing a Resource">
                    <t>
                        To update an existing resource to be shared, the
                        sharer simply adds one or more sharees to the
                        resource as per <xref target="sharee"/>. The server MUST
                        indicate that the resource is now shared by updating the
                        value of the DAV:share-mode WebDAV property.
                    </t>
                    <t>
                        To unshare a resource, the sharer simply removes all
                        sharees from the DAV:invite property of the resource as
                        per <xref target="sharee"/>. The server MUST indicate
                        that the resource is no longer shared by removing the
                        value from the DAV:share-mode WebDAV property.
                    </t>
                </section>
                <section title="Manipulating Sharees of a Shared Resource" anchor="sharee">
                    <t>
                        The sharer of a shared resource is able to manipulate
                        the sharee list by issuing a POST request targeted at
                        the resource. The POST request MUST contain an XML
                        document as its body with the root element being
                        <xref target="DAV:share-resource">DAV:share-resource</xref>.
                    </t>
                    <t>
                        The POST request MUST contain a Content-Type HTTP
                        header, which MUST contain "application/davshare+xml"
                        as its value. Servers SHOULD reject the request if
                        this is not the case.
                    </t>
                    <t>
                        The <xref target="DAV:share-resource">DAV:share-resource</xref> element in
                        the POST requests MUST contain one or more
                        <xref target="DAV:set-invitee">DAV:set-invitee</xref> or
                        <xref target="DAV:remove-invitee">DAV:remove-invitee</xref>
                        elements.
                        For each <xref target="DAV:set-invitee">DAV:set-invitee</xref>
                        element, the server MUST add the specified sharee
                        access to the resource. For each
                        <xref target="DAV:remove-invitee">DAV:remove-invitee</xref>
                        element the server MUST remove the specified sharee
                        access from the shared resource. In each case the
                        server MUST send a notification message to any sharees
                        whose status is changed (added, modified or removed),
                        indicating to them a change in status for the shared
                        resource. This is accomplished by sending a
                        <xref target="DAV:invite-notification">DAV:invite-notification</xref>
                        notification to each sharee.
                        The server SHOULD NOT send notification messages to
                        sharees whose status is unchanged.
                    </t>
                    <t>
                        Sharees are identified via a DAV:href element whose
                        value is either a principal-URL for a sharee hosted on
                        the same server, an email address, or any other URI
                        identifying a user.
                        In the case of the later two, the sharee might not be
                        a user on the same server - though in that case how
                        invitations are sent or access enabled is out of scope
                        for this specification. A server MAY change the
                        sharee's "address" to any suitable alternative that
                        it might prefer when returning the list of sharees via
                        the <xref target="DAV:invite">DAV:invite property</xref>.
                    </t>
                    <t>
                        The client MAY include a DAV:displayname element in
                        the <xref target="DAV:set-invitee">DAV:set-invitee</xref>
                        element.  When provided, the value represents the common
                        name for the sharee, and is returned in the list of
                        sharees via the <xref target="DAV:invite">DAV:invite property</xref>.
                        The server MAY change this to a suitable alternative
                        when it is able to match the sharee to a known user.
                        If absent from the client request, the server SHOULD
                        add a DAV:displayname when it is able to match the
                        sharee with a known user, and a common name for that
                        user can be determined.
                    </t>
                    <section title="Example: Successful Sharee Add Request">

                        <t>
                          This example shows how to add a single sharee (with email address "mailto:eric@example.com") to a shared resource with DAV:read-write access.
                        </t>

                        <figure>
                          <preamble>&gt;&gt; Request &lt;&lt;</preamble>
                          <artwork><![CDATA[
POST /calendars/users/cyrus/shared/ HTTP/1.1
Host: calendar.example.com
Content-Type: application/davsharing+xml; charset="utf-8"
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8" ?>
<D:share-resource xmlns:D="DAV:">
  <D:set-invitee>
    <D:href>mailto:eric@example.com</D:href>
    <D:displayname>Eric York</D:displayname>
    <D:comment>Shared workspace</D:comment>
    <D:read-write />
  </D:set-invitee>
</D:share-resource>]]></artwork>
                        </figure>
                        <figure>
                          <preamble>&gt;&gt; Response &lt;&lt;</preamble>
                          <artwork><![CDATA[
HTTP/1.1 200 OK
Cache-Control: no-cache
Date: Sat, 11 Nov 2006 09:32:12 GMT]]></artwork>
                        </figure>
                    </section>
                    <section title="Example: Successful Multiple Sharee Change Request">

                        <t>
                            This example shows how multiple sharee's can be manipulated in a single request. The sharee with email address "mailto:eric@example.com" has their access downgraded to CS:read, whilst another sharee is removed from the access list entirely.
                        </t>

                        <figure>
                          <preamble>&gt;&gt; Request &lt;&lt;</preamble>
                          <artwork><![CDATA[
POST /calendars/users/cyrus/shared/ HTTP/1.1
Host: calendar.example.com
Content-Type: application/davsharing+xml; charset="utf-8"
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8" ?>
<D:share-resource xmlns:D="DAV:">
  <D:set-invitee>
    <D:href>mailto:eric@example.com</D:href>
    <D:comment>Shared workspace</D:comment>
    <D:read-write />
  </D:set-invitee>
  <D:remove-invitee>
    <D:href>mailto:wilfredo@example.com</D:href>
  </D:remove-invitee>
</D:share-resource>]]></artwork>
                        </figure>
                        <figure>
                          <preamble>&gt;&gt; Response &lt;&lt;</preamble>
                          <artwork><![CDATA[
HTTP/1.1 204 No Content
Cache-Control: no-cache
Date: Sat, 11 Nov 2006 09:32:12 GMT]]></artwork>
                        </figure>
                    </section>
                </section>
            </section>
            <section title="Sharee Actions on Shared Resources">
                <section title="Replying to a Sharing Invite">
                    <t>
                        When a sharee is invited to a shared resource they
                        can accept or decline the invite by issuing a POST
                        request to the resource URI for the invitation
                        notification.  The POST request MUST contain an XML
                        document as its body with the root element being
                        <xref target="DAV:invite-reply">DAV:invite-reply</xref>.
                    </t>
                    <t>
                        The POST request MUST contain a Content-Type HTTP
                        header, which MUST contain "application/davshare+xml"
                        as its value. Servers SHOULD reject the request if
                        this is not the case.
                    </t>
                    <t>
                        The <xref target="DAV:invite-reply">DAV:invite-reply</xref>
                        element in the POST request specifies the accept or
                        decline action via the DAV:invite-accepted or
                        DAV:invite-declined elements, and an optional
                        DAV:comment element. IF the invite was accepted, the
                        body MUST also contain a <xref target="DAV:create-in">
                        DAV:create-in</xref> element. This element contains a
                        single DAV:href element, which content is a URI that
                        will be used as the parent for the new shared resource.
                    </t>
                    <t>
                        The client MAY also provide a <!--<xref target="DAV:slug">-->
                            DAV:slug<!--</xref>--> property. The server MAY use the
                        contents of this property to determine the name of
                        the new resource.
                    </t>
                    <t>
                        All usual preconditions for creating a resource at the
                        DAV:create-in target collection need to be taken into
                        consideration.
                    </t>
                    <t>
                        Note that some servers may restrict where certain types
                        of resources may be created. A CalDAV server for
                        instance, may only allow calendars to be created in
                        collections identified by the CALDAV:calendar-home-set
                        WebDAV property.
                    </t>
                    <t>
                        A successful response to an accepted invitation, SHOULD
                        have a HTTP 201 status code, and MUST have a HTTP
                        Location header, containing the full url to the newly
                        created resource.
                    </t>
                    <t>
                        A successful response to a declined invitation, SHOULD
                        contain a 200 or 204 HTTP status code.
                    </t>
                    <t>
                        When the sharee replies to an invite, the server
                        SHOULD send a notification to the sharer to update
                        them on the change in the sharee state. This is
                        accomplished by sending a
                        <xref target="DAV:reply-notification">DAV:reply-notification</xref>
                        notification to the sharer.
                    </t>
                    <t>
                        After the sharee has issued a reply, the server SHOULD
                        also remove the notification that contained the
                        initial invite.
                    </t>
                    <section title="Example: Accepting an invite">
                    <t>
                        This is an example of a request that the sharee would
                        send to accept an invitation.
                    </t>
                    <t>
                    <figure>
                        <artwork><![CDATA[
POST /principals/users/evert/notifications/1000455.xml HTTP/1.1
Host: calendar.example.com
Content-Type: application/davsharing+xml; charset="utf-8"

<?xml version="1.0" encoding="utf-8" ?>
<D:invite-reply xmlns:D="DAV:">
    <D:invite-accepted />
    <D:create-in>
        <D:href>/calendars/users/evert/</D:href>
    </D:create-in>
    <D:slug>Tech meetups</D:slug>
</D:invite-reply>
]]></artwork>
                    </figure>
                    </t>
                    </section>
                </section>
                <section title="Ignoring an invitation">
                    <t>
                        For privacy reasons, sharees need to be able to
                        remove invitations without notifiying the sharer.
                    </t>
                    <t>
                        When the sharee issues a DELETE on an
                        invite-notification, the server MUST remove the
                        notification, and MUST NOT let the sharer know about
                        this.
                    </t>
                    <t>
                        As a result, from the sharers perspective, the
                        invitation status for that principal will always
                        remain as DAV:invite-noreply.
                    </t>
                </section>
                <section title="Making modifications to a shared resource">
                    <t>
                        Any changes that a sharee makes to a shared resource
                        should also be reflected in the sharers instance of
                        the resource.
                    </t>
                    <t>
                        If the shared resource is a collection, any resources
                        in the collection, or in the collection's
                        child-collections MUST also appear in the sharers
                        instance.
                    </t>
                </section>
                <section title="Removing a shared resource">
                    <t>
                        To remove a shared resource a DELETE request is
                        targeted at the shared resource URI. When such a
                        request is received the server MUST remove the shared
                        collection and automatically update the sharee's
                        status in the sharer's DAV:invite property.
                    </t>
                </section>
            </section>
            <section title="General Considerations">
                <section title="Access Levels">
                    <t>
                        Two levels of access can be granted by a sharer to any sharee. These are governed by the DAV:access element used in the DAV:invite/DAV:user element that specifies a shared user invite. DAV:access contains a single empty element that defines the type of access granted:
                        <list style="hanging">
                        <t hangText="DAV:read">
                            When present this indicates that sharees can read information from the resource, but cannot change it. This applies to the resource, but if the shared resource is a collection, it also applies to the collection's children.
                        </t>
                        <t hangText="DAV:read-write">
                            When present this indicates that sharees can read and write information from the resource.
                        </t>
                        </list>
                    </t>
                    <t>
                        The function of the DAV:read and DAV:read-write
                        elements is to give a quick indicator for a sharee
                        what kind of access they may expect. The server may
                        still set more fine-grained access control rules. The
                        sharee can find out about these rules by requesting
                        the DAV:current-user-privilege-set property on the
                        shared resource, or its children.
                    </t>
                </section>
                <section title="Per-instance WebDAV Properties" anchor="per-instance-data">
                    <t>
                        Servers MUST support "per-instance" WebDAV properties
                        on shared resource and MAY support them on resources
                        within shared collections. A "per-instance" WebDAV
                        property is one whose value can be set and retrieved
                        on an instance of a resource, but is not
                        automatically propagated to other instances of the
                        same shared resource. For example, a sharee may
                        change a property on their instance of a shared
                        resource, but the instance of the owner of the
                        resource will not see this updated value.
                    </t>
                    <t>
                        For shared resources, the server MUST allow all
                        users to write "per-instance" WebDAV properties on the
                        shared resources and MAY allow property writes on
                        resources within the shared resources. This is
                        required even in the case where the sharee has been
                        granted read access only (i.e., the ability to
                        change the resource is disallowed). This requirement
                        ensures that sharees can always change "personal"
                        properties such as display names.
                    </t>
                    <t>
                        Servers MAY treat any dead property as per-instance.
                    </t>
                    <t>
                        Servers MUST NOT treat live properties as per-instance.
                    </t>
                </section>
            </section>
        </section>

        <section title="Sharing privileges">
            <t>
                Servers MAY support sharing on a per-resource basis.
                This section defines a "DAV:share"
                <xref target="RFC3744">WebDAV Access Control (ACL)</xref>
                privilege for use on collections that may be shared.
            </t>
            <t>
                This privilege MUST be non-abstract and MAY be protected.
                This privilege MUST appear in the DAV:supported-privilege-set
                property for resources that may be shared. In addition, it
                MUST appear in the DAV:current-user-privilege-set, if the user
                is allowed to share the collection.
            </t>
        </section>

        <section title='XML Element Definitions'>
            <section title="DAV:shared-owner" anchor="DAV:shared-owner">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">shared-owner</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Used to indicate that a resource is being shared by the owner.</t>
                    <t hangText="Description:">This property appears in the DAV:share-mode property on the resource shared by a sharer. See <xref target="properties"/>.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT shared-owner EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:shared" anchor="DAV:shared">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">shared</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Used to indicate that a resources is being shared to a sharee.</t>
                    <t hangText="Description:">This property appears in the DAV:share-mode property on a resource that is shared to a sharee. See <xref target="properties"/>.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT shared EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:share-mode" anchor="DAV:share-mode">
              <t>
                  <list style="hanging">
                    <t hangText="Name:">share-mode</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Used to indicate that a resource is being shared.</t>
                    <t hangText="Description:">This is a WebDAV property that may appear on an instance of a shared resource. See <xref target="properties" />.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT share-mode (shared | shared-owner)?>]]></artwork>
                      </figure>
                    </t>
                  </list>
              </t>
            </section>
            <section title="DAV:share" anchor="DAV:share">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">share</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">A WebDAV ACL privilege to control sharing.</t>
                    <t hangText="Description:">
                        This element represents a <xref target="RFC3744">WebDAV
                        ACL privilege</xref>, and indicates that the current
                        principal is allowed to share the resource on which
                        it is defined.
                    </t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT share EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:user" anchor="DAV:user">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">user</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Used to show status of sharing invites sent to sharees.</t>
                    <t hangText="Description:">This element provides the "status" of a sharing invite sent to a particular user. See <xref target="DAV:invite"/>.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT user (href, displayname?, (invite-noresponse |
                invite-accepted | invite-declined | invite-invalid),
                access, comment?)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:invite-noresponse">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">invite-noresponse</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Sharing invite status.</t>
                    <t hangText="Description:">When used in a <xref target="DAV:user">DAV:user</xref> element, this element is used to indicate that the sharee has never replied to the corresponding sharing invite. When used in a <xref target="DAV:invite-notification">DAV:invite-notification</xref> element, this element is used to indicate to the sharee that a sharing reply is needed.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-noresponse EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:invite-deleted">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">invite-deleted</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Sharing invite status.</t>
                    <t hangText="Description:">When used in a <xref target="DAV:invite-notification">DAV:invite-notification</xref> element, this element is used to indicate to the sharee that a shared resource has been unshared by the sharer.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-deleted EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:invite-accepted">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">invite-accepted</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Sharing invite status.</t>
                    <t hangText="Description:">When used in a <xref target="DAV:user">DAV:user</xref> element, this element is used to indicate that the sharee has accepted the corresponding sharing invite. When used in a <xref target="DAV:invite-notification">DAV:invite-notification</xref> element, this element is used to indicate to the sharee that the sharing invite is an update for one they previously accepted.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-accepted EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:invite-declined">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">invite-declined</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Sharing invite status.</t>
                    <t hangText="Description:">When used in a <xref target="DAV:user">DAV:user</xref> element, this element is used to indicate that the sharee has declined the corresponding sharing invite. When used in a <xref target="DAV:invite-notification">DAV:invite-notification</xref> element, this element is used to indicate to the sharee that the sharing invite is an update for one they previously declined.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-declined EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:invite-invalid">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">invite-invalid</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Sharing invite status.</t>
                    <t hangText="Description:">When used in a <xref target="DAV:user">DAV:user</xref> element, this element is used to indicate that the corresponding sharee is not a valid user known to the server.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-invalid EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:access">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">access</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Shared resource access level.</t>
                    <t hangText="Description:">When used in a <xref target="DAV:user">DAV:user</xref> element, this element is used to indicate the sharing access level granted to the corresponding sharee.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT access (read | read-write)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:read">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">read</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Shared resource access level privilege.</t>
                    <t hangText="Description:">Indicates that the access level granted only allows sharees to read data in the shared resource (though they can write <xref target="per-instance-data">per-instance data</xref>).</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT read EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:read-write">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">read-write</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Shared resource access level privilege.</t>
                    <t hangText="Description:">Indicates that the access level granted allows sharees to read and write all data in the resource.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT read-write EMPTY>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:invite-notification" anchor="DAV:invite-notification">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">invite-notification</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">A notification used as a shared resource invite.</t>
                    <t hangText="Description:">Defines a notification message sent automatically by the server when a sharer adds, changes or removes a sharee from a shared resource. The DAV:href element specifies the URI of the sharee to whom the message was sent.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-notification (
            dav:href,
            (invite-noresponse | invite-deleted |
            invite-accepted | invite-declined),
            access, principal,
            comment?,
>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:hosturl">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">hosturl</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Identifies the source URL of a shared resource.</t>
                    <t hangText="Description:">Contains a single DAV:href element that refers to the source of a shared resource - i.e., the URL of the resource shared by the sharer.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT hosturl (DAV:href)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:organizer">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">organizer</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Identifies the sharer of a shared resource.</t>
                    <t hangText="Description:">
                        Contains a single DAV:href element that identifies the
                        URI of the sharer of a shared resource, and an optional
                        DAV:displayname element that matches that user.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT organizer (href,
                     displayname?)?)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:invite-reply" anchor="DAV:invite-reply">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">invite-reply</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Root element for a POST request used to respond to a share invitation.</t>
                    <t hangText="Description:">When a user responds to an invitation, the user issues a POST request with an xml body. DAV:invite-reply is the root element for this xml document.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-reply (href,
                        (invite-accepted | invite-declined),
                        hosturl, create-in?, comment?>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:reply-notification" anchor="DAV:reply-notification">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">reply-notification</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">A notification used as a reply to a shared resource invite.</t>
                    <t hangText="Description:">Defines a notification message sent automatically by the server when a sharee replies to a shared resource invite. The DAV:href element specifies the URI of the sharee to whom the original invite message was sent.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT invite-reply (href,
                        (invite-accepted | invite-declined),
                        hosturl, create-in?, comment?>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:create-in" anchor="DAV:create-in">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">create-in</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">The target url for the new resource.</t>
                    <t hangText="Description:">
                        When a user accepts an invitation to share a resource, this URI will be used to create the new shared resource.
                    </t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT create-in (DAV:href)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:share-resource" anchor="DAV:share-resource">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">share-resource</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Describes changes to sharees.</t>
                    <t hangText="Description:">The root element used in POST requests on resources by sharers to manipulate the sharee list of a shared resource.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT share-resource (set | remove)*>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:set-invitee" anchor="DAV:set-invitee">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">set-invitee</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Sets access for a sharee.</t>
                    <t hangText="Description:">Used to add or modify sharee access to a shared resource. The specified access to the shared resource is given to the sharee.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT set-invitee (href, displayname?, comment?,
               (read | read-write)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:remove-invitee" anchor="DAV:remove-invitee">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">remove-invitee</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Removes access for a sharee.</t>
                    <t hangText="Description:">Used to remove sharee access to a shared resource. All access to the shared resource is removed for the sharee.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT remove-invitee (href)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
            <section title="DAV:shared-as" anchor="DAV:shared-as">
                <t>
                  <list style="hanging">
                    <t hangText="Name:">shared-as</t>
                    <t hangText="Namespace:">DAV:</t>
                    <t hangText="Purpose:">Identifies a shared resource.</t>
                    <t hangText="Description:">Returned by the server for a POST request by a sharee accepting a shared resource invite. The DAV:href element specifies the URI of the resource created by the acceptance.</t>
                    <t hangText="Definition:">
                      <figure>
                        <artwork><![CDATA[
<!ELEMENT shared-as (DAV:href)>]]></artwork>
                      </figure>
                    </t>
                  </list>
                </t>
            </section>
        </section>

        <section title='Security Considerations'>
            <t>
                TBD
            </t>
        </section>
        <section title='IANA Considerations'>
            <t>
                This document does not require any actions on the part of IANA.
            </t>
        </section>
        <section title='Acknowledgments'>
          <t>
             The authors would like to thank the members of the Calendaring and
             Scheduling Consortium's SharingTechnical Committee. In particular,
             the following individuals have made important contributions to
             this work: Richard Brigham, John Chaffee, Michael Douglass and
             Ken Murchison and Dave Thewlis.
          </t>
           <t>
             This specification originated from work at the Calendaring and
             Scheduling Consortium, which has supported the development and
             testing of implementations of the specification.
           </t>
        </section>
        <section title='IANA Considerations'>
            <t>
                This document defines a MIME media type for XML documents
                used in for sharing. This media type SHOULD be used for all
                POST requests in this specification.
            </t>
            <t>
            <list style="hanging">
              <t hangText="Type name:">application</t>
              <t hangText="Subtype name:">davsharing+xml</t>
              <t hangText="Required parameters:">none</t>
              <t hangText="Optional parameters:">none</t>
              <t hangText="Encoding considerations:">Identical to those of "application/xml" as described in <xref target="RFC7303">RFC7303</xref>.</t>
              <t hangText="Security considerations:">N/A.</t>
              <t hangText="Interoperability considerations:">There are no known interoperability issues.</t>
              <t hangText="Published specification:">This specification.</t>
              <t hangText="Applications that use this media type:">No known applications currently use this media type.</t>
              <t hangText="Fragment identifier considerations:">N/A.</t>
            </list>
          </t>
          <t>Additional information</t>
          <t>
          <list style="hanging">
              <t hangText="Deprecated alias names for this type">N/A.</t>
              <t hangText="Magic number(s)">N/A.</t>
              <t hangText="File extension(s)">xml</t>
              <t hangText="Macintosh file type code(s)">TEXT</t>
              <t hangText="Person &amp; email address to contact for further information:">me@evertpot.com</t>
              <t hangText="Intended usage">COMMON</t>
              <t hangText="Restrictions on usage">There are no restrictions on where this media</t>
              <t hangText="Author">See the "Authors' Addresses" section of this document.</t>
              <t hangText="Change Controller">IETF</t>
          </list>
          </t>
        </section>
    </middle>
    <back>
        <references title='Normative References'>
            &rfc2119;
            &rfc3744;
            &rfc4791;
            &rfc4918;
            &rfc6352;
            &rfc7303;
        </references>
<!--
<references title='Informative References'>
</references>
-->
        <section title='Backwards compatibility'>
            <t>
                This specification is based on an earlier effort, often referred
                to as 'caldav-sharing'. It is possible to remain compatibile with
                this specification, but it's important to be aware of a number of
                changes.
            </t>
            <t>
                The earlier draft uses the http://calendarserver.org/ns/
                namespace for all its xml elements. This means that any
                WebDAV property introduced in this specification, may need
                to have a similar property in the old namespace.
            </t>
            <t>
                XML documents as sent by POST requests and responses, and
                resources returned from notifications can be distinguished by
                the use of the Content-Type and Accept HTTP headers. The earlier
                draft does not define new mime-types for these, but this
                specification does.
            </t>
        </section>
        <section title='Change History (to be removed prior to publication as an RFC'>
            <t>Changes in -02:
                <list style='numbers'>
                  <t>Renamed DAV:shared-url to DAV:sharer-instance-url</t>
                  <t>Introduced DAV:share-mode WebDAV property</t>
                  <t>Removed additions to DAV:resource-type to indicate that a resource is shared.</t>
                </list>
            </t>
            <t>Changes in -01:
                <list style='numbers'>
                    <t>Fixed some issues in the DTD declatations of set-invitee and remove-invitee.</t>
                    <t>Removed an unused normative reference.</t>
                    <t>Removed 'open issues' section.</t>
                    <t>Added a paragraph about xml/dtd handling with a reference to RFC4917</t>
                    <t>Renamed DAV:share to DAV:share-resource for the POST request</t>
                </list>
            </t>
        </section>
    </back>
</rfc>
