INTERNET-DRAFT       

draft-ietf-webdav-acl-12

 

 

 

Expires April 10, 2004

Geoffrey Clemm, IBM

Anne Hopkins, Microsoft Corporation

Eric Sedlar, Oracle Corporation

Jim Whitehead, U.C. Santa Cruz


October 10, 2003

WebDAV Access Control Protocol

Status of this Memo

This document is an Internet-Draft and is subject to all provisions of Section 10 of RFC2026.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt

The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.

Abstract

This document specifies a set of methods, headers, message bodies, properties, and reports that define Access Control extensions to the WebDAV Distributed Authoring Protocol. This protocol permits a client to read and modify access control lists that instruct a server whether to allow or deny operations upon a resource (such as HyperText Transfer Protocol (HTTP) method invocations) by a given principal. A lightweight representation of principals as Web resources supports integration of a wide range of user management repositories. Search operations allow discovery and manipulation of principals using human names.

This document is a product of the Web Distributed Authoring and Versioning (WebDAV) working group of the Internet Engineering Task Force. Comments on this draft are welcomed, and should be addressed to the acl@webdav.org mailing list. Other related documents can be found at http://www.example.com/acl/, and http://www.ics.uci.edu/pub/ietf/webdav/.


Table of Contents

1       Introduction  4

1.1      Terms. 5

1.2          Notational Conventions. 6

2       Principals  6

3       Privileges  6

3.1      DAV:read Privilege  7

3.2          DAV:write Privilege  7

3.3          DAV:write-properties. 7

3.4          DAV:write-content 8

3.5          DAV:unlock  8

3.6          DAV:read-acl Privilege. 8

3.7          DAV:read-current-user-privilege-set Privilege  8

3.8          DAV:write-acl Privilege. 8

3.9      DAV:bind Privilege  9

3.10          DAV:unbind Privilege. 9

3.11    DAV:all Privilege  9

3.12          Aggregation of Predefined Privileges  9

4     Principal Properties. 9

4.1          DAV:alternate-URI-set 10

4.2          DAV:principal-URL  10

4.3          DAV:group-member-set 10

4.4          DAV:group-membership. 10

5     Access Control Properties. 10

5.1          DAV:owner 11

5.1.1    Example: Retrieving DAV:owner 11

5.1.2    Example: An Attempt to Set DAV:owner 11

5.2          DAV:supported-privilege-set 12

5.2.1    Example: Retrieving a List of Privileges Supported on a Resource  13

5.3          DAV:current-user-privilege-set 15

5.3.1    Example: Retrieving the User's Current Set of Assigned Privileges  15

5.4      DAV:acl 16

5.4.1    ACE Principal 16

5.4.2    ACE Grant and Deny. 17

5.4.3    ACE Protection  17

5.4.4    ACE Inheritance  17

5.4.5    Example: Retrieving a Resource's Access Control List 17

5.5      DAV: acl-restrictions. 19

5.5.1          DAV:grant-only  19

5.5.2    DAV:no-invert ACE Constraint 19

5.5.3          DAV:deny-before-grant 19

5.5.4    Required Principals  19

Example: Retrieving DAV:acl-restrictions  19

5.6          DAV:inherited-acl-set 20

5.7          DAV:principal-collection-set 21

5.7.1    Example: Retrieving DAV:principal-collection-set 21

5.8      Example: PROPFIND to retrieve access control properties  22

6     ACL EVALUATION. 24

7     Access Control and Existing Methods. 25

7.1      ANY HTTP METHOD. 26

7.1.1    Error Handling  26

7.2          OPTIONS  26

7.2.1    Example - OPTIONS  26

7.3      MOVE. 27

7.4      COPY. 27

7.5      LOCK. 27

8     Access Control Methods. 27

8.1      ACL. 27

8.1.1    ACL Preconditions  28

8.1.2    Example: the ACL method. 29

8.1.3    Example: ACL method failure due to protected ACE conflict 29

8.1.4    Example: ACL method failure due to an inherited ACE conflict 30

8.1.5    Example: ACL method failure due to an attempt to set grant and deny in a single ACE. 31

9     Access Control Reports. 32

9.1      REPORT Method  32

9.2      DAV:acl-principal-prop-set Report 32

9.2.1    Example: DAV:acl-principal-prop-set Report 33

9.3          DAV:principal-match REPORT  34

9.3.1    Example: DAV:principal-match REPORT  34

9.4          DAV:principal-property-search REPORT. 35

9.4.1    Matching. 36

9.4.2    Example: successful DAV:principal-property-search REPORT  37

9.5          DAV:principal-search-property-set REPORT  38

9.5.1    Example: DAV:principal-search-property-set REPORT  39

10       XML PROCESSING.. 40

11          Internationalization Considerations  40

12          Security Considerations  41

12.1    Increased Risk of Compromised Users  41

12.2    Risks of the DAV:read-acl and DAV:current-user-privilege-set Privileges. 41

12.3    No Foreknowledge of Initial ACL. 41

13          Authentication. 42

14       IANA Considerations  42

15          Intellectual Property. 42

16          Acknowledgements  42

17          References  43

17.1          Normative References. 43

17.2          Informational References. 43

18          Authors' Addresses. 44

19          Appendices  45

19.1    WebDAV XML Document Type Definition Addendum   45

19.2    WebDAV Method Privilege Table (Normative) 47

 

1         Introduction

The goal of the WebDAV access control extensions is to provide an interoperable mechanism for handling discretionary access control for content and metadata managed by WebDAV servers.  WebDAV access control can be implemented on content repositories with security as simple as that of a UNIX file system, as well as more sophisticated models.  The underlying principle of access control is that who you are determines what operations you can perform on a resource. The "who you are" is defined by a "principal" identifier; users, client software, servers, and groups of the previous have principal identifiers. The "operations you can perform" are determined by a single "access control list" (ACL) associated with a resource.  An ACL contains a set of "access control entries" (ACEs), where each ACE specifies a principal and a set of privileges that are either granted or denied to that principal. When a principal submits an operation (such as an HTTP or WebDAV method) to a resource for execution, the server evaluates the ACEs in the ACL to determine if the principal has permission for that operation.

Since every ACE contains the identifier of a principal, client software operated by a human must provide a mechanism for selecting this principal. This specification uses http(s) scheme URLs to identify principals, which are represented as WebDAV-capable resources. There is no guarantee that the URLs identifying principals will be meaningful to a human. For example, http://www.example.com/u/256432 and http://www.example.com/people/Greg.Stein are both valid URLs that could be used to identify the same principal. To remedy this, every principal resource has the DAV:displayname property containing a human-readable name for the principal.

Since a principal can be identified by multiple URLs, it raises the problem of determining exactly which principal is being referenced in a given ACE. It is impossible for a client to determine that an ACE granting the read privilege to http://www.example.com/people/Greg.Stein also affects the principal at http://www.example.com/u/256432. That is, a client has no mechanism for determining that two URLs identify the same principal resource.  As a result, this specification requires clients to use just one of the many possible URLs for a principal when creating ACEs. A client can discover which URL to use by retrieving the DAV:principal-URL property (Section 4.2) from a principal resource. No matter which of the principal's URLs is used with PROPFIND, the property always returns the same URL.

With a system having hundreds to thousands of principals, the problem arises of how to allow a human operator of client software to select just one of these principals. One approach is to use broad collection hierarchies to spread the principals over a large number of collections, yielding few principals per collection. An example of this is a two level hierarchy with the first level containing 36 collections (a-z, 0-9), and the second level being another 36, creating collections /a/a/, /a/b/, ..., /a/z/, such that a principal with last name "Stein" would appear at /s/t/Stein. In effect, this pre-computes a common query, search on last name, and encodes it into a hierarchy. The drawback with this scheme is that it handles only a small set of predefined queries, and drilling down through the collection hierarchy adds unnecessary steps (navigate down/up) when the user already knows the principal's name. While organizing principal URLs into a hierarchy is a valid namespace organization, users should not be forced to navigate this hierarchy to select a principal.

This specification provides the capability to perform substring searches over a small set of properties on the resources representing principals. This permits searches based on last name, first name, user name, job title, etc. Two separate searches are supported, both via the REPORT method, one to search principal resources (DAV:principal-property-search, Section 9.4), the other to determine which properties may be searched at all (DAV:principal-search-property-set, Section 9.5).

Once a principal has been identified in an ACE, a server evaluating that ACE must know the identity of the principal making a protocol request, and must validate that that principal is who they claim to be, a process known as authentication. This specification intentionally omits discussion of authentication, as the HTTP protocol already has a number of authentication mechanisms [RFC2617].  Some authentication mechanism (such as HTTP Digest Authentication, which all WebDAV compliant implementations are required to support) must be available to validate the identity of a principal.

The following issues are out of scope for this document:

·         Access control that applies only to a particular property on a resource (excepting the access control properties DAV:acl and DAV:current-user-privilege-set), rather than the entire resource,

·         Role-based security (where a role can be seen as a dynamically defined group of principals),

·         Specification of the ways an ACL on a resource is initialized,

·         Specification of an ACL that applies globally to all resources, rather than to a particular resource.

·         Creation and maintenance of resources representing people or computational agents (principals), and groups of these.

This specification is organized as follows. Section 1.1 defines key concepts used throughout the specification, and is followed by a more in-depth discussion of principals (Section 2), and privileges (Section 3). Properties defined on principals are specified in Section 4, and access control properties for content resources are specified in Section 5. The ways ACLs are to be evaluated is described in section 6. Client discovery of access control capability using OPTIONS is described in Section 7.1. Interactions between access control functionality and existing HTTP and WebDAV methods are described in the remainder of Section 7. The access control setting method, ACL, is specified in Section 8. Four reports that provide limited server-side searching capabilities are described in Section 9. Sections on XML processing (Section 10), Internationalization considerations (Section 11), security considerations (Section 12), and authentication (Section 13) round out the specification. An appendix (Section 19.1) provides an XML Document Type Definition (DTD) for the XML elements defined in the specification.

1.1        Terms

This draft uses the terms defined in HTTP [RFC2616] and WebDAV [RFC2518].  In addition, the following terms are defined:

principal

A "principal" is a distinct human or computational actor that initiates access to network resources.  In this protocol, a principal is an HTTP resource that represents such an actor.

group

A "group" is a principal that represents a set of other principals.

privilege

A "privilege" controls access to a particular set of HTTP operations on a resource.

aggregate privilege

An "aggregate privilege" is a privilege that contains a set of other privileges.

abstract privilege

The modifier "abstract", when applied to a privilege on a resource, means the privilege cannot be set in an access control element (ACE) on that resource .

access control list (ACL)

An "ACL" is a list of access control elements that define access control to a particular resource.

access control element (ACE)

An "ACE" either grants or denies a particular set of (non-abstract) privileges for a particular principal.

inherited ACE

An "inherited ACE" is an ACE that is dynamically shared from the ACL of another resource. When a shared ACE changes on the primary resource, it is also changed on inheriting resources.

protected property

A "protected property" is one whose value cannot be updated except by a method explicitly defined as updating that specific property.  In particular, a protected property cannot be updated with a PROPPATCH request.

1.2        Notational Conventions

The augmented BNF used by this document to describe protocol elements is described in Section 2.1 of [RFC2616]. Because this augmented BNF uses the basic production rules provided in Section 2.2 of [RFC2616], those rules apply to this document as well.

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 [RFC2119].

Definitions of XML elements in this document use XML element type declarations (as found in XML Document Type Declarations), described in Section 3.2 of [REC-XML]. When an XML element type in the "DAV:" namespace is referenced in this document outside of the context of an XML fragment, the string "DAV:" will be prefixed to the element name.

2         Principals

A principal is a network resource that represents a distinct human or computational actor that initiates access to network resources. Users and groups are represented as principals in many implementations; other types of principals are also possible. A URI of any scheme MAY be used to identify a principal resource. However, servers implementing this specification MUST expose principal resources at an http(s) URL, which is a privileged scheme that points to resources that have additional properties, as described in Section 4. So, a principal resource can have multiple URIs, one of which has to be an http(s) scheme URL. Although an implementation SHOULD support PROPFIND and MAY support PROPPATCH to access and modify information about a principal, it is not required to do so. 

A principal resource may be a group, where a group is a principal that represents a set of other principals, called the members of the group.  If a person or computational agent matches a principal resource that is a member of a group, they also match the group. Membership in a group is recursive, so if a principal is a member of group GRPA, and GRPA is a member of group GRPB, then the principal is also a member of GRPB.

3         Privileges

Ability to perform a given method on a resource MUST be controlled by one or more privileges.  Authors of protocol extensions that define new HTTP methods SHOULD specify which privileges (by defining new privileges, or mapping to ones below) are required to perform the method.  A principal with no privileges to a resource MUST be denied any HTTP access to that resource, unless the principal matches an ACE constructed using the DAV:all, DAV:authenticated, or DAV:unauthenticated pseudo-principals (see Section 5.4.1).  Servers MUST report a 403 "Forbidden" error if access is denied, except in the case where the privilege restricts the ability to know the resource exists, in which case 404 "Not Found" may be returned.

Privileges may be containers of other privileges, in which case they are termed "aggregate privileges".  If a principal is granted or denied an aggregate privilege, it is semantically equivalent to granting or denying each of the aggregated privileges individually.  For example, an implementation may define add-member and remove-member privileges that control the ability to add and remove a member of a group.  Since these privileges control the ability to update the state of a group, these privileges would be aggregated by the DAV:write privilege on a group, and granting the DAV:write privilege on a group would also grant the add-member and remove-member privileges.

Privileges may be declared to be "abstract" for a given resource, in which case they cannot be set in an ACE on that resource. Aggregate and non-aggregate privileges are both capable of being abstract. Abstract privileges are useful for modeling privileges that otherwise would not be exposed via the protocol. Abstract privileges also provide server implementations with flexibility in implementing the privileges defined in this specification.  For example, if a server is incapable of separating the read resource capability from the read ACL capability, it can still model the DAV:read and DAV:read-acl privileges defined in this specification by declaring them abstract, and containing them within a non-abstract aggregate privilege (say, read-all) that holds DAV:read, and DAV:read-acl. In this way, it is possible to set the aggregate privilege, read-all, thus coupling the setting of DAV:read and DAV:read-acl, but it is not possible to set DAV:read, or DAV:read-acl individually. Since aggregate privileges can be abstract, it is also possible to use abstract privileges to group or organize non-abstract privileges. Privilege containment loops are not allowed; therefore, a privilege MUST NOT contain itself. For example, DAV:read cannot contain DAV:read.

The set of privileges that apply to a particular resource may vary with the DAV:resourcetype of the resource, as well as between different server implementations.  To promote interoperability, however, this specification defines a set of well-known privileges (e.g. DAV:read, DAV:write, DAV:read-acl, DAV:write-acl, DAV:read-current-user-privilege-set, and DAV:all), which can at least be used to classify the other privileges defined on a particular resource. The access permissions on null resources (defined in [RFC2518], Section 3) are solely those they inherit (if any), and they are not discoverable (i.e., the access control properties specified in Section 5 are not defined on null resources). On the transition from null to stateful resource, the initial access control list is set by the server's default ACL value policy (if any).

Server implementations MAY define new privileges beyond those defined in this specification. Privileges defined by individual implementations MUST NOT use the DAV: namespace, and instead should use a namespace that they control, such as an http scheme URL.

3.1        DAV:read Privilege

The read privilege controls methods that return information about the state of the resource, including the resource's properties. Affected methods include GET and PROPFIND.  Any implementation-defined privilege that also controls access to GET and PROPFIND must be aggregated under DAV:read—if an ACL grants access to DAV:read, the client may expect that no other privilege needs to be granted to have access to GET and PROPFIND.  Additionally, the read privilege MUST control the OPTIONS method.

<!ELEMENT read EMPTY>

3.2        DAV:write Privilege

The write privilege controls methods that lock a resource or modify the content, dead properties, or (in the case of a collection) membership of the resource, such as PUT and PROPPATCH.  Note that state modification is also controlled via locking (see section 5.3 of [WEBDAV]), so effective write access requires that both write privileges and write locking requirements are satisfied.  Any implementation-defined privilege that also controls access to methods modifying content, dead properties or collection membership must be aggregated under DAV:write, e.g. if an ACL grants access to DAV:write, the client may expect that no other privilege needs to be granted to have access to PUT and PROPPATCH. 

<!ELEMENT write EMPTY>

3.3        DAV:write-properties

The DAV:write-properties privilege controls methods that modify the dead properties of the resource, such as PROPPATCH.  Whether this privilege may be used to control access to any live properties is determined by the implementation.  Any implementation-defined privilege that also controls access to methods modifying dead properties must be aggregated under DAV:write-properties—e.g. if an ACL grants access to DAV:write-properties, the client can safely expect that no other privilege needs to be granted to have access to PROPPATCH.

<!ELEMENT write-properties EMPTY>

3.4        DAV:write-content

The DAV:write-content privilege controls methods that modify the content or (in the case of a collection) membership of the resource, such as PUT and DELETE.  Any implementation-defined privilege that also controls access to content or alteration of collection membership must be aggregated under DAV:write-content—e.g. if an ACL grants access to DAV:write-content, the client can safely expect that no other privilege needs to be granted to have access to PUT or DELETE.

<!ELEMENT write-content EMPTY>

3.5        DAV:unlock

The DAV:unlock privilege controls the use of the UNLOCK method by a principal other than the lock owner (the principal that created a lock can always perform an UNLOCK).  While the set of users who may lock a resource is most commonly the same set of users who may modify a resource, servers may allow various kinds of administrators to unlock resources locked by others. Any privilege controlling access by non-lock owners to UNLOCK MUST be aggregated under DAV:unlock.

A lock owner can always remove a lock by issuing an UNLOCK with the correct lock token and authentication credentials. That is, even if a principal does not have DAV:unlock privilege, they can still remove locks they own. Principals other than the lock owner can remove a lock only if they have DAV:unlock privilege and they issue an UNLOCK with the correct lock token. Lock timeout is not affected by the DAV:unlock privilege.

<!ELEMENT unlock EMPTY>

3.6        DAV:read-acl Privilege

The DAV:read-acl privilege controls the use of PROPFIND to retrieve the DAV:acl property of the resource.

<!ELEMENT read-acl EMPTY>

3.7        DAV:read-current-user-privilege-set Privilege

The DAV:read-current-user-privilege-set privilege controls the use of PROPFIND to retrieve the DAV:current-user-privilege-set property of the resource.

Clients are intended to use this property to visually indicate in their UI items that are dependent on the permissions of a resource, for example, by graying out resources that are not writeable.

This privilege is separate from DAV:read-acl because there is a need to allow most users access to the privileges permitted the current user (due to its use in creating the UI), while the full ACL contains information that may not be appropriate for the current authenticated user. As a result, the set of users who can view the full ACL is expected to be much smaller than those who can read the current user privilege set, and hence distinct privileges are needed for each.

<!ELEMENT read-current-user-privilege-set EMPTY>

3.8        DAV:write-acl Privilege

The DAV:write-acl privilege controls use of the ACL method to modify the DAV:acl property of the resource.

<!ELEMENT write-acl EMPTY>

3.9        DAV:bind Privilege

The DAV:bind privilege allows a method to add a new member URL to the specified collection (for example via PUT or MKCOL).  It is ignored for resources that are not collections. 

<!ELEMENT bind EMPTY>

3.10    DAV:unbind Privilege

The DAV:unbind privilege allows a method to remove a member URL from the specified collection (for example via DELETE or MOVE).  It is ignored for resources that are not collections. 

<!ELEMENT unbind EMPTY>

3.11    DAV:all Privilege

DAV:all is an aggregate privilege that contains the entire set of privileges that can be applied to the resource.

<!ELEMENT all EMPTY>

3.12    Aggregation of Predefined Privileges

Server implementations are free to aggregate the predefined privileges (defined above in Sections 3.1-3.9) subject to the following limitations:

DAV:read-acl MUST NOT contain DAV:read, DAV:write, DAV:write-acl, DAV:write-properties, DAV:write-content, or DAV:read-current-user-privilege-set.

DAV:write-acl MUST NOT contain DAV:write, DAV:read, DAV:read-acl, or DAV:read-current-user-privilege-set.

DAV:read-current-user-privilege-set MUST NOT contain DAV:write, DAV:read, DAV:read-acl, or DAV:write-acl.

DAV:write MUST NOT contain DAV:read, DAV:read-acl, or DAV:read-current-user-privilege-set.

DAV:read MUST NOT contain DAV:write, DAV:write-acl, DAV:write-properties, or DAV:write-content.

DAV:write MUST contain DAV:write-properties and DAV:write-content.

4         Principal Properties

Principals are manifested to clients as a WebDAV resource, identified by a URL.  A principal MUST have a non-empty DAV:displayname property (defined in Section 13.2 of [RFC2518]), and a DAV:resourcetype property (defined in Section 13.9 of [RFC2518]).  Additionally, a principal MUST report the DAV:principal XML element in the value of the DAV:resourcetype property.  The element type declaration for DAV:principal is:

<!ELEMENT principal EMPTY>

 

This protocol defines the following additional properties for a principal. Since it can be expensive for a server to retrieve access control information, the name and value of these properties SHOULD NOT be returned by a PROPFIND allprop request (as defined in Section 12.14.1 of [RFC2518]).

4.1        DAV:alternate-URI-set

This protected property, if non-empty, contains the URIs of network resources with additional descriptive information about the principal. This property identifies additional network resources (i.e., it contains one or more URIs) that may be consulted by a client to gain additional knowledge concerning a principal. One expected use for this property is the storage of an LDAP [RFC2255] scheme URL. A user-agent encountering an LDAP URL could use LDAP [RFC2589] to retrieve additional machine-readable directory information about the principal, and display that information in its user interface. Support for this property is REQUIRED, and the value is empty if no alternate URI exists for the principal.

<!ELEMENT alternate-URI-set (href*)>

4.2        DAV:principal-URL

 A principal may have many URLs, but there must be one "principal URL" that clients can use to uniquely identify a principal.  This protected property contains the URL that MUST be used to identify this principal in an ACL request. Support for this property is REQUIRED.

<!ELEMENT principal-URL (href)>

4.3        DAV:group-member-set

This property of a group principal identifies the principals that are direct members of this group. Since a group may be a member of another group, a group may also have indirect members (i.e. the members of its direct members).  A URL in the DAV:group-member-set for a principal MUST be the DAV:principal-URL of that principal.

<!ELEMENT group-member-set (href*)>

 

4.4        DAV:group-membership

 This protected property identifies the groups in which the principal is directly a member.  Note that a server may allow a group to be a member of another group, in which case the DAV:group-membership of those other groups would need to be queried in order to determine the groups in which the principal is indirectly a member. Support for this property is REQUIRED.

<!ELEMENT group-membership (href*)>

 

5         Access Control Properties

This specification defines a number of new properties for WebDAV resources.  Access control properties may be retrieved just like other WebDAV properties, using the PROPFIND method.  Since it is expensive, for many servers, to retrieve access control information, a PROPFIND allprop request (as defined in Section 12.14.1 of [RFC2518]) SHOULD NOT return the names and values of the properties defined in this section.

Access control properties (especially DAV:acl and DAV:inherited-acl-set) are defined on the resource identified by the Request-URI of a PROPFIND request. A direct consequence is that if the resource is accessible via multiple URI, the value of access control properties is the same across these URI.

HTTP resources that support the WebDAV Access Control Protocol MUST contain the following properties. Null resources (described in Section 3 of [RFC2518]) MUST NOT contain the following properties.

5.1        DAV:owner

This protected property identifies a particular principal as being the "owner" of the resource. Since the owner of a resource often has special access control capabilities (e.g., the owner frequently has permanent DAV:write-acl privilege), clients might display the resource owner in their user interface.

<!ELEMENT owner (href)>

5.1.1           Example: Retrieving DAV:owner

This example shows a client request for the value of the DAV:owner property from a collection resource with URL http://www.example.com/papers/. The principal making the request is authenticated using Digest authentication. The value of DAV:owner is the URL http://www.example.com/acl/users/gstein, wrapped in the DAV:href XML element.

>> Request <<

 

PROPFIND /papers/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="jim",

   realm="jim@webdav.org", nonce="...",

   uri="/papers/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:propfind xmlns:D="DAV:">

  <D:prop>

    <D:owner/>

  </D:prop>

</D:propfind>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:multistatus xmlns:D="DAV:">

   <D:response>

      <D:href>http://www.example.com/papers/</D:href>

      <D:propstat>

         <D:prop>

            <D:owner>

               <D:href>http://www.example.com/acl/users/gstein</D:href>      

            </D:owner>

         </D:prop>

         <D:status>HTTP/1.1 200 OK</D:status>

     </D:propstat>

   </D:response>

</D:multistatus>

5.1.2           Example: An Attempt to Set DAV:owner

The following example shows a client request to modify the value of the DAV:owner property on the resource with URL <http://www.example.com/papers>. Since DAV:owner is a protected property, the server responds with a 207 (Multi-Status) response that contains a 403 (Forbidden) status code for the act of setting DAV:owner. Section 8.2.1 of [RFC2518] describes PROPPATCH status code information, and Section 11 of [RFC2518] describes the Multi-Status response.

>> Request <<

 

PROPPATCH /papers/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="jim",

   realm="jim@webdav.org", nonce="...",

   uri="/papers/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:propertyupdate xmlns:D="DAV:">

   <D:set>

      <D:prop>

         <D:owner>

            <D:href>http://www.example.com/acl/users/jim</D:href>

         </D:owner>

      </D:prop>

   </D:set>

</D:propertyupdate>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:multistatus xmlns:D="DAV:">

   <D:response>

      <D:href>http://www.example.com/papers/</D:href>

      <D:propstat>

         <D:prop><D:owner/></D:prop>

         <D:status>HTTP/1.1 403 Forbidden</D:status>

         <D:responsedescription>

           Failure to set protected property (DAV:owner)

         </D:responsedescription>

      </D:propstat>

   </D:response>

</D:multistatus>

 

5.2        DAV:supported-privilege-set

This is a protected property that identifies the privileges defined for the resource. 

<!ELEMENT supported-privilege-set (supported-privilege*)>

 

Each privilege appears as an XML element, where aggregate privileges list as sub-elements all of the privileges that they aggregate.

<!ELEMENT supported-privilege

 (privilege, abstract?, description, supported-privilege*)>

<!ELEMENT privilege ANY>

 

An abstract privilege MUST NOT be used in an ACE for that resource. Servers MUST fail an attempt to set an abstract privilege.

<!ELEMENT abstract EMPTY>

 

A description is a human-readable description of what this privilege controls access to. Servers MUST indicate the human language of the description using the xml:lang attribute and SHOULD consider the HTTP Accept-Language request header when selecting one of multiple available languages.

<!ELEMENT description #PCDATA>

 

It is envisioned that a WebDAV ACL-aware administrative client would list the supported privileges in a dialog box, and allow the user to choose non-abstract privileges to apply in an ACE.  The privileges tree is useful programmatically to map well-known privileges (defined by WebDAV or other standards groups) into privileges that are supported by any particular server implementation.  The privilege tree also serves to hide complexity in implementations allowing large number of privileges to be defined by displaying aggregates to the user.

5.2.1           Example: Retrieving a List of Privileges Supported on a Resource

This example shows a client request for the DAV:supported-privilege-set property on the resource http://www.example.com/papers/. The value of the DAV:supported-privilege-set property is a tree of supported privileges (using "[XML Namespace , localname]" to identify each privilege):

   [DAV:, all] (aggregate, abstract)

      |

      +-- [DAV:, read] (aggregate)

             |

             +-- [DAV:, read-acl] (abstract)

             +-- [DAV:, read-current-user-privilege-set] (abstract)

      |

      +-- [DAV:, write] (aggregate)

             |

             +-- [DAV:, write-acl] (abstract)

             +-- [DAV:, write-properties]

             +-- [DAV:, write-content]

      |

      +-- [DAV:, unlock]

 

This privilege tree is not normative (except that it reflects the normative aggregation rules given in Section 3.12), and many possible privilege trees are possible.

 

>> Request <<

 

PROPFIND /papers/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="gclemm",

   realm="gclemm@webdav.org", nonce="...",

   uri="/papers/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:propfind xmlns:D="DAV:">

  <D:prop>

    <D:supported-privilege-set/>

  </D:prop>

</D:propfind>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:multistatus xmlns:D="DAV:">

  <D:response>

    <D:href>http://www.example.com/papers/</D:href>

    <D:propstat>

      <D:prop>

        <D:supported-privilege-set>

          <D:supported-privilege>

            <D:privilege> <D:all/> </D:privilege>

            <D:abstract/>

            <D:description xml:lang="en">Any operation</D:description>

            <D:supported-privilege>

              <D:privilege> <D:read/> </D:privilege>

              <D:description xml:lang="en">Read any object</D:description>

              <D:supported-privilege>

                <D:privilege> <D:read-acl/> </D:privilege>

                <D:abstract/>

                <D:description xml:lang="en">Read ACL</D:description>

              </D:supported-privilege>

              <D:supported-privilege>

                <D:privilege>

                  <D:read-current-user-privilege-set/>

                </D:privilege>

                <D:abstract/>

                <D:description xml:lang="en">Read current user privilege set property</D:description>

              </D:supported-privilege>

              </D:supported-privilege>

              <D:supported-privilege>

              <D:privilege> <D:write/> </D:privilege>

              <D:description xml:lang="en">Write any object</D:description>

              <D:supported-privilege>

                <D:privilege> <D:write-acl/> </D:privilege>

                <D:description xml:lang="en">Write ACL</D:description>

                <D:abstract/>

              </D:supported-privilege>

              <D:supported-privilege>

                <D:privilege> <D:write-properties/> </D:privilege>

                <D:description xml:lang="en">Write properties</D:description>

              </D:supported-privilege>

              <D:supported-privilege>

                <D:privilege> <D:write-content/> </D:privilege>

                <D:description xml:lang="en">Write resource content</D:description>

              </D:supported-privilege>

              </D:supported-privilege>

              <D:supported-privilege>

                <D:privilege> <D:unlock/> </D:privilege>

                <D:description xml:lang="en">Unlock resource</D:description>

              </D:supported-privilege>

          </D:supported-privilege>

        </D:supported-privilege-set>

      </D:prop>

      <D:status>HTTP/1.1 200 OK</D:status>

    </D:propstat>

  </D:response>

</D:multistatus>

5.3        DAV:current-user-privilege-set

DAV:current-user-privilege-set is a protected property containing the exact set of privileges (as computed by the server) granted to the currently authenticated HTTP user. Aggregate privileges and their contained privileges are listed. A user-agent can use the value of this property to adjust its user interface to make actions inaccessible (e.g., by graying out a menu item or button) for which the current principal does not have permission. This property is also useful for determining what operations the current principal can perform, without having to actually execute an operation.

<!ELEMENT current-user-privilege-set (privilege*)>

<!ELEMENT privilege ANY>

 

If the current user is granted a specific privilege, that privilege must belong to the set of privileges that may be set on this resource. Therefore, each element in the DAV:current-user-privilege-set property MUST identify a non-abstract privilege from the DAV:supported-privilege-set property.

5.3.1           Example: Retrieving the User's Current Set of Assigned Privileges

Continuing the example from Section 5.2.1, this example shows a client requesting the DAV:current-user-privilege-set property from the resource with URL http://www.example.com/papers/. The username of the principal making the request is "khare", and Digest authentication is used in the request. The principal with username "khare" has been granted the DAV:read privilege. Since the DAV:read privilege contains the DAV:read-acl and DAV:read-current-user-privilege-set privileges (see Section 5.2.1), the principal with username "khare" can read the ACL property, and the DAV:current-user-privilege-set property. However, the DAV:all, DAV:read-acl, DAV:write-acl and DAV:read-current-user-privilege-set privileges are not listed in the value of DAV:current-user-privilege-set, since (for this example) they are abstract privileges. DAV:write is not listed since the principal with username "khare" is not listed in an ACE granting that principal write permission.

>> Request <<

 

PROPFIND /papers/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="khare",

   realm="khare@webdav.org", nonce="...",

   uri="/papers/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:propfind xmlns:D="DAV:">

  <D:prop>

    <D:current-user-privilege-set/>

  </D:prop>

</D:propfind>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:multistatus xmlns:D="DAV:">

  <D:response>

    <D:href>http://www.example.com/papers/</D:href>

    <D:propstat>

      <D:prop>

        <D:current-user-privilege-set>

          <D:privilege> <D:read/> </D:privilege>

        </D:current-user-privilege-set>

      </D:prop>

      <D:status>HTTP/1.1 200 OK</D:status>

    </D:propstat>

  </D:response>

</D:multistatus>

5.4        DAV:acl

This is a protected property that specifies the list of access control entries (ACEs), which define what principals are to get what privileges for this resource.

<!ELEMENT acl (ace*) >

 

Each DAV:ace element specifies the set of privileges to be either granted or denied to a single principal.  If the DAV:acl property is empty, no principal is granted any privilege.

<!ELEMENT ace ((principal | invert), (grant | deny), protected?, inherited?)>

5.4.1           ACE Principal

The DAV:principal element identifies the principal to which this ACE applies.

<!ELEMENT principal (href | all | authenticated | unauthenticated

 | property | self)>

 

The current user matches DAV:href only if that user is authenticated as being (or being a member of) the principal identified by the URL contained by that DAV:href.

The current user always matches DAV:all.

<!ELEMENT all EMPTY>

 

The current user matches DAV:authenticated only if authenticated.

<!ELEMENT authenticated EMPTY>

 

The current user matches DAV:unauthenticated only if not authenticated.

<!ELEMENT unauthenticated EMPTY>

 

DAV:all is the union of DAV:authenticated, and DAV:unauthenticated. For a given request, the user matches either DAV:authenticated, or DAV:unauthenticated, but not both (that is, DAV:authenticated and DAV:unauthenticated are disjoint sets).

The current user matches a DAV:property principal in a DAV:acl property of a resource only if the value of the identified property of that resource contains at most one DAV:href XML element, the URI value of DAV:href identifies a principal, and the current user is authenticated as being (or being a member of) that principal.  For example, if the DAV:property element contained <DAV:owner/>, the current user would match the DAV:property principal only if the current user is authenticated as matching the principal identified by the DAV:owner property of the resource.

<!ELEMENT property ANY>

 

The current user matches DAV:self in a DAV:acl property of the resource only if that resource is a principal and that principal matches the current user or, if the principal is a group, a member of that group matches the current user.

<!ELEMENT self EMPTY>

 

Some servers may support ACEs applying to those users NOT matching the current principal, e.g. all users not in a particular group.  This can be done by wrapping the DAV:principal element with DAV:invert.

<!ELEMENT invert principal>

5.4.2           ACE Grant and Deny

Each DAV:grant or DAV:deny element specifies the set of privileges to be either granted or denied to the specified principal.  A DAV:grant or DAV:deny element of the DAV:acl of a resource MUST only contain non-abstract elements specified in the DAV:supported-privilege-set of that resource.

<!ELEMENT grant (privilege+)>

<!ELEMENT deny (privilege+)>

<!ELEMENT privilege ANY>

5.4.3           ACE Protection

A server indicates an ACE is protected by including the DAV:protected element in the ACE. If the ACL of a resource contains an ACE with a DAV:protected element, an attempt to remove that ACE from the ACL MUST fail.

<!ELEMENT protected EMPTY>

5.4.4           ACE Inheritance

The presence of a DAV:inherited element indicates that this ACE is inherited from another resource that is identified by the URL contained in a DAV:href element.  An inherited ACE cannot be modified directly, but instead the ACL on the resource from which it is inherited must be modified.

Note that ACE inheritance is not the same as ACL initialization.  ACL initialization defines the ACL that a newly created resource will use (if not specified).  ACE inheritance refers to an ACE that is logically shared - where an update to the resource containing an ACE will affect the ACE of each resource that inherits that ACE.  The method by which ACLs are initialized or by which ACEs are inherited is not defined by this document.

<!ELEMENT inherited (href)>

5.4.5           Example: Retrieving a Resource's Access Control List

Continuing the example from Sections 5.2.1 and 5.3.1, this example shows a client requesting the DAV:acl property from the resource with URL http://www.example.com/papers/. There are two ACEs defined in this ACL:

ACE #1: The group identified by URL http://www.example.com/acl/groups/maintainers (the group of site maintainers) is granted DAV:write privilege. Since (for this example) DAV:write contains the DAV:write-acl privilege (see Section 5.2.1), this means the "maintainers" group can also modify the access control list.

ACE #2: All principals (DAV:all) are granted the DAV:read privilege. Since (for this example) DAV:read contains DAV:read-acl and DAV:read-current-user-privilege-set, this means all users (including all members of the "maintainers" group) can read the DAV:acl property and the DAV:current-user-privilege-set property.

 

>> Request <<

 

PROPFIND /papers/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="masinter",

   realm="webdav.org", nonce="...",

   uri="/papers/", response="...", opaque="..."

 

<D:propfind xmlns:D="DAV:">

  <D:prop>

    <D:acl/>

  </D:prop>

</D:propfind>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<D:multistatus xmlns:D="DAV:">

  <D:response>

    <D:href>http://www.example.com/papers/</D:href>

    <D:propstat>

       <D:prop>

        <D:acl>

          <D:ace>

            <D:principal>

<D:href>http://www.example.com/acl/groups/maintainers</D:href>

            </D:principal>

            <D:grant>

              <D:privilege> <D:write/> </D:privilege>

            </D:grant>

          </D:ace>

          <D:ace>

            <D:principal>

              <D:all/>

            </D:principal>

            <D:grant>

              <D:privilege> <D:read/> </D:privilege>

            </D:grant>

          </D:ace>

        </D:acl>

      </D:prop>

      <D:status>HTTP/1.1 200 OK</D:status>

    </D:propstat>

  </D:response>

</D:multistatus>

 

5.5        DAV: acl-restrictions

This protected property defines the types of ACLs supported by this server, to avoid clients needlessly getting errors.  When a client tries to set an ACL via the ACL method, the server may reject the attempt to set the ACL as specified.  The following properties indicate the restrictions the client must observe before setting an ACL:

                <grant-only>                      Deny ACEs are not supported

                <no-invert>                   Inverted ACEs are not supported

                <deny-before-grant>                All deny ACEs must occur before any grant ACEs

                <required-principal>                Indicates which principals are required to be present

 

<!ELEMENT acl-restrictions (grant-only?, no-invert?, deny-before-grant?, required-principal?)>

 

5.5.1           DAV:grant-only

This element indicates that ACEs with deny clauses are not allowed.

<!ELEMENT grant-only EMPTY>

5.5.2           DAV:no-invert ACE Constraint

This element indicates that ACEs with the <invert> element are not allowed.

<!ELEMENT no-invert EMPTY>

5.5.3           DAV:deny-before-grant

This element indicates that all deny ACEs must precede all grant ACEs.

<!ELEMENT deny-before-grant EMPTY>

5.5.4           Required Principals

The required principal elements identify which principals must have an ACE defined in the ACL. 

<!ELEMENT required-principal

  (all? | authenticated? | unauthenticated? | self? | href* | property*)>

 

For example, the following element requires that the ACL contain a DAV:owner property ACE:

<D:required-principal xmlns:D="DAV:">

  <D:property> <D:owner/> </D:property>

</D:required-principal>

 

      Example: Retrieving DAV:acl-restrictions

In this example, the client requests the value of the DAV:acl-restrictions property. Digest authentication provides credentials for the principal operating the client.

 

>> Request <<

 

PROPFIND /papers/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="srcarter",

   realm="srcarter@webdav.org", nonce="...",

   uri="/papers/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:propfind xmlns:D="DAV:">

  <D:prop>

    <D:acl-restrictions/>

  </D:prop>

</D:propfind>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:multistatus xmlns:D="DAV:">

  <D:response>

    <D:href>http://www.example.com/papers/</D:href>

    <D:propstat>

        <D:prop>

        <D:acl-restrictions>

            <D:grant-only/>

          <D:required-principal>

            <D:all/>

          </D:required-principal>

        </D:acl-restrictions>

      </D:prop>

      <D:status>HTTP/1.1 200 OK</D:status>

    </D:propstat>

  <D:response>

</D:multistatus>

 

5.6        DAV:inherited-acl-set

This protected property contains a set of URLs that identify other resources that also control the access to this resource.  To have a privilege on a resource, not only must the ACL on that resource (specified in the DAV:acl property of that resource) grant the privilege, but so must the ACL of each resource identified in the DAV:inherited-acl-set property of that resource.  Effectively, the privileges granted by the current ACL are ANDed with the privileges granted by each inherited ACL.

<!ELEMENT inherited-acl-set (href*)>

 

5.7        DAV:principal-collection-set

This protected property of a resource contains a set of URLs that identify the root collections that contain the principals that are available on the server that implements this resource.  A WebDAV Access Control Protocol user agent could use the contents of DAV:principal-collection-set to retrieve the DAV:displayname property (specified in Section 13.2 of [RFC2518]) of all principals on that server, thereby yielding human-readable names for each principal that could be displayed in a user interface.

<!ELEMENT principal-collection-set (href*)>

Since different servers can control different parts of the URL namespace, different resources on the same host MAY have different DAV:principal-collection-set values. The collections specified in the DAV:principal-collection-set MAY be located on different hosts from the resource. The URLs in DAV:principal-collection-set SHOULD be http or https scheme URLs. For security and scalability reasons, a server MAY report only a subset of the entire set of known principal collections, and therefore clients should not assume they have retrieved an exhaustive listing. Additionally, a server MAY elect to report none of the principal collections it knows about, in which case the property value would be empty.

The value of DAV:principal-collection-set gives the scope of the DAV:principal-property-search REPORT (defined in Section 9.4). Clients use the DAV:principal-property-search REPORT to populate their user interface with a list of principals. Therefore, servers that limit a client's ability to obtain principal information will interfere with the client's ability to manipulate access control lists, due to the difficulty of getting the URL of a principal for use in an ACE.

5.7.1           Example: Retrieving DAV:principal-collection-set

In this example, the client requests the value of the DAV:principal-collection-set property on the collection resource identified by URL http://www.example.com/papers/. The property contains the two URLs, http://www.example.com/acl/users/ and http://www.example.com/acl/groups/, both wrapped in DAV:href XML elements. Digest authentication provides credentials for the principal operating the client.

The client might reasonably follow this request with two separate PROPFIND requests to retrieve the DAV:displayname property of the members of the two collections (/acl/users and /acl/groups). This information could be used when displaying a user interface for creating access control entries.

 

>> Request <<

 

PROPFIND /papers/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="yarong",

   realm="yarong@webdav.org", nonce="...",

   uri="/papers/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:propfind xmlns:D="DAV:">

  <D:prop>

    <D:principal-collection-set/>

  </D:prop>

</D:propfind>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:multistatus xmlns:D="DAV:">

 <D:response>

  <D:href>http://www.example.com/papers/</D:href>

  <D:propstat>

   <D:prop>

     <D:principal-collection-set>

      <D:href>http://www.example.com/acl/users/</D:href>

      <D:href>http://www.example.com/acl/groups/</D:href>

     </D:principal-collection-set>

   </D:prop>

   <D:status>HTTP/1.1 200 OK</D:status>

  </D:propstat>

 </D:response>

</D:multistatus>

5.8        Example: PROPFIND to retrieve access control properties

The following example shows how access control information can be retrieved by using the PROPFIND method to fetch the values of the DAV:owner, DAV:supported-privilege-set, DAV:current-user-privilege-set, and DAV:acl properties.

>> Request <<

 

PROPFIND /top/container/ HTTP/1.1

Host: www.example.com

Content-type: text/xml; charset="utf-8"

Content-Length: xxx

Depth: 0

Authorization: Digest username="ejw",

   realm="users@foo.org", nonce="...",

   uri="/top/container/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:propfind xmlns:D="DAV:">

  <D:prop>

    <D:owner/>

    <D:supported-privilege-set/>

    <D:current-user-privilege-set/>

    <D:acl/>

  </D:prop>

</D:propfind>

 

>> Response <<

 

HTTP/1.1 207 Multi-Status

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:multistatus

   xmlns:D="DAV:"

   xmlns:A="http://www.example.com/acl/"> <D:response>

  <D:href>http://www.example.com/top/container/</D:href>

  <D:propstat>

  <D:prop>

    <D:owner>

      <D:href>http://www.example.com/users/gclemm</D:href> </D:owner>

    <D:supported-privilege-set>

      <D:supported-privilege>

        <D:privilege> <D:all/> </D:privilege>

        <D:abstract/>

        <D:description xml:lang="en">Any operation</D:description>

        <D:supported-privilege>

          <D:privilege> <D:read/> </D:privilege>

          <D:description xml:lang="en">Read any object</D:description>

        </D:supported-privilege>

        <D:supported-privilege>

          <D:privilege> <D:write/> </D:privilege>

          <D:abstract/>

          <D:description xml:lang="en">Write any object</D:description>

          <D:supported-privilege>

            <D:privilege> <A:create/> </D:privilege>

            <D:description xml:lang="en">Create an object</D:description>

          </D:supported-privilege>

          <D:supported-privilege>

            <D:privilege> <A:update/> </D:privilege>

            <D:description xml:lang="en">Update an object</D:description>

          </D:supported-privilege>

          <D:supported-privilege>

            <D:privilege> <A:unbind/> </D:privilege>

            <D:description xml:lang="en">Remove binding to an object</D:description>

          </D:supported-privilege>

        </D:supported-privilege>

        <D:supported-privilege>

          <D:privilege> <D:read-acl/> </D:privilege>

          <D:description xml:lang="en">Read the ACL</D:description>

        </D:supported-privilege>

        <D:supported-privilege>

          <D:privilege> <D:write-acl/> </D:privilege>

          <D:description xml:lang="en">Write the ACL</D:description>

        </D:supported-privilege>

      </D:supported-privilege>

    </D:supported-privilege-set>

    <D:current-user-privilege-set>

      <D:privilege> <D:read/> </D:privilege>

      <D:privilege> <D:read-acl/> </D:privilege>

    </D:current-user-privilege-set>

    <D:acl>

      <D:ace>

        <D:principal>

          <D:href>http://www.example.com/users/esedlar</D:href>

          </D:principal>

        <D:grant>

          <D:privilege> <D:read/> </D:privilege>

          <D:privilege> <D:write/> </D:privilege>

          <D:privilege> <D:read-acl/> </D:privilege> </D:grant>

      </D:ace>

      <D:ace>

        <D:principal>

          <D:href>http://www.example.com/groups/marketing</D:href>

        </D:principal>

        <D:deny>

          <D:privilege> <D:read/> </D:privilege> </D:deny>

      </D:ace>

      <D:ace>

        <D:principal>

          <D:property> <D:owner/> </D:property> </D:principal>

        <D:grant>

          <D:privilege> <D:read-acl/> </D:privilege>

          <D:privilege> <D:write-acl/> </D:privilege> </D:grant>

      </D:ace>

      <D:ace>

        <D:principal> <D:all/> </D:principal>

        <D:grant>

          <D:privilege> <D:read/> </D:privilege></D:grant>

        <D:inherited>

          <D:href>http://www.example.com/top</D:href> </D:inherited>

      </D:ace> </D:acl>

    </D:prop>

    <D:status>HTTP/1.1 200 OK</D:status>

  </D:propstat> </D:response> </D:multistatus>

 

The value of the DAV:owner property is a single DAV:href XML element containing the URL of the principal that owns this resource.

The value of the DAV:supported-privilege-set property is a tree of supported privileges (using "[XML Namespace , localname]" to identify each privilege):

   [DAV:, all] (aggregate, abstract)

      |

      +-- [DAV:, read]

      +-- [DAV:, write] (aggregate, abstract)

             |

             +-- [http://www.example.com/acl, create]

             +-- [http://www.example.com/acl, update]

             +-- [http://www.example.com/acl, delete]

      +-- [DAV:, read-acl]

      +-- [DAV:, write-acl]

 

The DAV:current-user-privilege-set property contains two privileges, DAV:read, and DAV:read-acl. This indicates that the current authenticated user only has the ability to read the resource, and read the DAV:acl property on the resource.

The DAV:acl property contains a set of four ACEs:

ACE #1: The principal identified by the URL http://www.example.com/users/esedlar is granted the DAV:read, DAV:write, and DAV:read-acl privileges.

ACE #2: The principals identified by the URL http://www.example.com/groups/marketing are denied the DAV:read privilege.  In this example, the principal URL identifies a group.

ACE #3: In this ACE, the principal is a property principal, specifically the DAV:owner property. When evaluating this ACE, the value of the DAV:owner property is retrieved, and is examined to see if it contains a DAV:href XML element. If so, the URL within the DAV:href element is read, and identifies a principal. In this ACE, the owner is granted DAV:read-acl, and DAV:write-acl privileges.

ACE #4: This ACE grants the DAV:all principal (all users) the DAV:read privilege. This ACE is inherited from the resource http://www.example.com/top, the parent collection of this resource.

6         ACL EVALUATION

WebDAV ACLs are evaluated in similar manner as ACLs on Windows NT and in NFSv4 [NFSV4]).  An ACL is evaluated to determine whether or not access will be granted for a WebDAV request.  ACEs are maintained in a particular order, and are evaluated until all of the permissions required by the current request have been granted, at which point the ACL evaluation is terminated and access is granted.  If, during ACL evaluation, a <deny> ACE (matching the current user) is encountered for a privilege which has not yet been granted, the ACL evaluation is terminated and access is denied.  Failure to have all required privileges granted results in access being denied.

 

Note that the semantics of many other existing ACL systems may be represented via this mechanism, by mixing deny and grant ACEs.  For example, consider the standard "rwx" privilege scheme used by UNIX.  In this scheme, if the current user is the owner of the file, access is granted if the corresponding privilege bit is set and denied if not set, regardless of the permissions set on the file’s group and for the world.  An ACL for UNIX permissions of "r--rw-r--"might be constructed like:

      <D:acl>

      <D:ace>

        <D:principal><D:property><D:owner/></D:property></D:principal>

        <D:grant><D:privilege><D:read/></D:privilege></D:grant>

      </D:ace>

      <D:ace>

        <D:principal><D:property><D:owner/></D:property></D:principal>

        <D:deny><D:privilege><D:all/></D:privilege></D:deny>

      </D:ace>

      <D:ace>

        <D:principal><D:property><D:group/></D:property></D:principal>

        <D:grant><D:privilege><D:read/></D:privilege>

                 <D:privilege><D:write/></D:privilege></D:grant>

      </D:ace>

      <D:ace>

        <D:principal><D:property><D:group/></D:property></D:principal>

        <D:deny><D:privilege><D:all/></D:privilege></D:deny>

      </D:ace>

      <D:ace>

        <D:principal><D:all></D:principal>

        <D:grant><D:privilege><D:read/></D:privilege></D:grant>

      </D:ace>

      </D:acl>

and the <acl-restrictions> would be defined as:

<D:no-invert/>
<D:required-principal>
  <D:all/>
  <D:property><D:owner/></D:property>
  <D:property><D:group/><D:group/>
</D:required-principal>

Note that the client can still get errors from a UNIX server in spite of obeying the <acl-restrictions>, including <D:allowed-principal> (adding an ACE specifying a principal other than the ones in the ACL above) or <D:ace-conflict> (by trying to reorder the ACEs in the example above), as these particular implementation semantics are too complex to be captured with the simple (but general) declarative restrictions.

 

7         Access Control and Existing Methods

This section defines the impact of access control functionality on existing methods.

7.1        ANY HTTP METHOD

7.1.1           Error Handling

The WebDAV ACL mechanism requires the usage of HTTP method "preconditions" as described in section 1.6 of RFC3253 for ALL HTTP methods.  All HTTP methods have an additional precondition called DAV:need-privileges.  If an HTTP method fails due to insufficient privileges, the response body to the "403 Forbidden" error MUST contain the <DAV:error> element, which in turn contains the <DAV:need-privileges> element, which contains one or more <DAV:resource> elements indicating which resource had insufficient privileges, and what the lacking privileges were:

<!ELEMENT need-privileges (resource)* >

<!ELEMENT resource ( href , privilege ) >

 

Since some methods require multiple permissions on multiple resources, this information is needed to resolve any ambiguity.  There is no requirement that all privilege violations be reported—for implementation reasons, some servers may only report the first privilege violation. For example:

>> Request <<

 

MOVE /a/b/ HTTP/1.1

Host: www.example.com

Destination: http://www.example.com/c/d

 

>> Response <<

 

HTTP/1.1 403 Forbidden

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<D:error xmlns:D="DAV:">
  <D:need-privileges>
    <D:resource>
      <D:href>/a</D:href>

      <D:privilege><D:unbind/></D:privilege>

    </D:resource>

    <D:resource>

      <D:href>/c</D:href>

      <D:privilege><D:bind/></D:privilege>

    </D:resource>

  </D:need-privileges>

</D:error>

7.2        OPTIONS

If the server supports access control, it MUST return "access-control" as a field in the DAV response header from an OPTIONS request on any resource implemented by that server. A value of "access-control" in the DAV header MUST indicate that the server supports all MUST level requirements and REQUIRED features specified in this document.

7.2.1           Example - OPTIONS

>> Request <<

 

  OPTIONS /foo.html HTTP/1.1

  Host: www.example.com

  Content-Length: 0

  
>> Response <<

 

  HTTP/1.1 200 OK

  DAV: 1, 2, access-control

  Allow: OPTIONS, GET, PUT, PROPFIND, PROPPATCH, ACL

 

In this example, the OPTIONS response indicates that the server supports access control and that /foo.html can have its access control list modified by the ACL method.

7.3        MOVE

When a resource is moved from one location to another due to a MOVE request, the non-inherited and non-protected ACEs in the DAV:acl property of the resource MUST NOT be modified, or the MOVE request fails. Handling of inherited and protected ACEs is intentionally undefined to give server implementations flexibility in how they implement ACE inheritance and protection.

7.4        COPY

The DAV:acl property on the resource at the destination of a COPY MUST be the same as if the resource was created by an individual resource creation request (e.g. MKCOL, PUT). Clients wishing to preserve the DAV:acl property across a copy need to read the DAV:acl property prior to the COPY, then perform an ACL operation on the new resource at the destination to restore, insofar as this is possible, the original access control list.

7.5        LOCK

A lock on a resource ensures that only the lock owner can modify ACEs that are not inherited and not protected  (these are the only ACEs that a client can modify with an ACL request). A lock does not protect inherited or protected ACEs, since a client cannot modify them with an ACL request on that resource.

8         Access Control Methods

8.1        ACL

The ACL method modifies the access control list (which can be read via the DAV:acl property) of a resource.  Specifically, the ACL method only permits modification to ACEs that are not inherited, and are not protected. An ACL method invocation modifies all non-inherited and non-protected ACEs in a resource's access control list to exactly match the ACEs contained within in the DAV:acl XML element (specified in Section 5.4) of the request body. An ACL request body MUST contain only one DAV:acl XML element. Unless the non-inherited and non-protected ACEs of the DAV:acl property of the resource can be updated to be exactly the value specified in the ACL request, the ACL request MUST fail.

It is possible that the ACEs visible to the current user in the DAV:acl property may only be a portion of the complete set of ACEs on that resource. If this is the case, an ACL request only modifies the set of ACEs visible to the current user, and does not affect any non-visible ACE.

In order to avoid overwriting DAV:acl changes by another client, a client SHOULD acquire a WebDAV lock on the resource before retrieving the DAV:acl property of a resource that it intends on updating.

Implementation Note: Two common operations are to add or remove an ACE from an existing access control list. To accomplish this, a client uses the PROPFIND method to retrieve the value of the DAV:acl property, then parses the returned access control list to remove all inherited and protected ACEs (these ACEs are tagged with the DAV:inherited and DAV:protected XML elements). In the remaining set of non-inherited, non-protected ACEs, the client can add or remove one or more ACEs before submitting the final ACE set in the request body of the ACL method.

8.1.1           ACL Preconditions

An implementation MUST enforce the following constraints on an ACL request.  If the constraint is violated, a 403 (Forbidden) or 409 (Conflict) response MUST be returned and the indicated XML element MUST be returned as a child of a top level DAV:error element in an XML response body.

Though these status elements are generally expressed as empty XML elements (and are defined as EMPTY in the DTD), implementations MAY return additional descriptive XML elements as children of the status element. Clients MUST be able to accept children of these status elements. Clients that do not understand the additional XML elements should ignore them.

(DAV:no-ace-conflict): The ACEs submitted in the ACL request MUST NOT conflict with each other.  This is a catchall error code indicating that an implementation-specific ACL restriction has been violated.

(DAV:no-protected-ace-conflict): The ACEs submitted in the ACL request MUST NOT conflict with the protected ACEs on the resource. For example, if the resource has a protected ACE granting DAV:write to a given principal, then it would not be consistent if the ACL request submitted an ACE denying DAV:write to the same principal.

(DAV:no-inherited-ace-conflict): The ACEs submitted in the ACL request MUST NOT conflict with the inherited ACEs on the resource. For example, if the resource inherits an ACE from its parent collection granting DAV:write to a given principal, then it would not be consistent if the ACL request submitted an ACE denying DAV:write to the same principal. Note that reporting of this error will be implementation-dependent. Implementations MUST either report this error or allow the ACE to be set, and then let normal ACE evaluation rules determine whether the new ACE has any impact on the privileges available to a specific principal.

(DAV:limited-number-of-aces): The number of ACEs submitted in the ACL request MUST NOT exceed the number of ACEs allowed on that resource.  However, ACL-compliant servers MUST support at least one ACE granting privileges to a single principal, and one ACE granting privileges to a group.

(DAV:deny-before-grant): All non-inherited deny ACEs MUST precede all non-inherited grant ACEs.

 (DAV:grant-only): The ACEs submitted in the ACL request MUST NOT include a deny ACE.  This precondition applies only when the ACL restrictions of the resource include the DAV:grant-only constraint (defined in Section 5.5.1).

(DAV:no-invert):  The ACL request MUST NOT include a DAV:invert element.   This precondition applies only when the ACL semantics of the resource includes the DAV:no-invert constraint (defined in Section 6.3.4).

(DAV:no-abstract): The ACL request MUST NOT attempt to grant or deny an abstract privilege (see Section 5.2).

(DAV:not-supported-privilege): The ACEs submitted in the ACL request MUST be supported by the resource.

(DAV:missing-required-principal): The result of the ACL request MUST have at least one ACE for each principal identified in a DAV:required-principal XML element in the ACL semantics of that resource (see Section 5.5.4).

(DAV:recognized-principal): Every principal URL in the ACL request MUST identify a principal resource.

(DAV:allowed-principal): The principals specified in the ACEs submitted in the ACL request MUST be allowed as principals for the resource. For example, a server where only authenticated principals can access resources would not allow the DAV:all or DAV:unauthenticated principals to be used in an ACE, since these would allow unauthenticated access to resources.

8.1.2           Example: the ACL method

In the following example, user "fielding", authenticated by information in the Authorization header, grants the principal identified by the URL http://www.example.com/users/esedlar  (i.e., the user "esedlar") read and write privileges, grants the owner of the resource read-acl and write-acl privileges, and grants everyone read privileges.

>> Request <<

 

ACL /top/container/ HTTP/1.1

Host: www.example.com

Content-Type: text/xml; charset="utf-8"

Content-Length: xxxx

Authorization: Digest username="fielding",

   realm="users@foo.org", nonce="...",

   uri="/top/container/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:acl xmlns:D="DAV:">

  <D:ace>

    <D:principal>

      <D:href>http://www.example.com/users/esedlar</D:href>

    </D:principal>

    <D:grant>

      <D:privilege> <D:read/> </D:privilege>

      <D:privilege> <D:write/> </D:privilege>

    </D:grant>

  </D:ace>

  <D:ace>

    <D:principal>

      <D:property> <D:owner/> </D:property>

    </D:principal>

    <D:grant>

      <D:privilege> <D:read-acl/> </D:privilege>

      <D:privilege> <D:write-acl/> </D:privilege>

    </D:grant>

  </D:ace>

  <D:ace>

    <D:principal> <D:all/> </D:principal>

    <D:grant>

      <D:privilege> <D:read/> </D:privilege>

    </D:grant>

  </D:ace> </D:acl>

 

>> Response <<

 

HTTP/1.1 200 OK

8.1.3           Example: ACL method failure due to protected ACE conflict

In the following request, user "fielding", authenticated by information in the Authorization header, attempts to deny the principal identified by the URL http://www.example.com/users/esedlar  (i.e., the user "esedlar") write privileges. Prior to the request, the DAV:acl property on the resource contained a protected ACE (see Section 5.4.3) granting DAV:owner the DAV:read and DAV:write privileges. The principal identified by URL http://www.example.com/users/esedlar is the owner of the resource. The ACL method invocation fails because the submitted ACE conflicts with the protected ACE, thus violating the semantics of ACE protection.

>> Request <<

 

ACL /top/container/ HTTP/1.1

Host: www.example.com

Content-Type: text/xml; charset="utf-8"

Content-Length: xxxx

Authorization: Digest username="fielding",

   realm="users@foo.org", nonce="...",

   uri="/top/container/", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:acl xmlns:D="DAV:">

  <D:ace>

    <D:principal>

      <D:href>http://www.example.com/users/esedlar</D:href>

    </D:principal>

    <D:deny>

      <D:privilege> <D:write/> </D:privilege>

    </D:deny>

  </D:ace>

</D:acl>

 

>> Response <<

 

HTTP/1.1 403 Forbidden

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:error xmlns:D="DAV:">

  <D:no-protected-ace-conflict/>

</D:error>

8.1.4           Example: ACL method failure due to an inherited ACE conflict

In the following request, user "ejw", authenticated by information in the Authorization header, tries to change the access control list on the resource http://www.example.com/top/index.html. This resource has two inherited ACEs.

Inherited ACE #1 grants the principal identified by URL http://www.example.com/users/ejw (i.e., the user "ejw") http://www.example.com/privs/write-all and DAV:read-acl privileges. On this server, http://www.example.com/privs/write-all is an aggregate privilege containing DAV:write, and DAV:write-acl.

Inherited ACE #2 grants principal DAV:all the DAV:read privilege.

The request attempts to set a (non-inherited) ACE, denying the principal identified by the URL http://www.example.com/users/ejw (i.e., the user "ejw") DAV:write permission. This conflicts with inherited ACE #1. Note that the decision to report an inherited ACE conflict is specific to this server implementation. Another server implementation could have allowed the new ACE to be set, and then used normal ACE evaluation rules to determine whether the new ACE has any impact on the privileges available to a principal.

>> Request <<

 

ACL /top/index.html HTTP/1.1

Host: www.example.com

Content-Type: text/xml; charset="utf-8"

Content-Length: xxxx

Authorization: Digest username="ejw",

   realm="users@foo.org", nonce="...",

   uri="/top/index.html", response="...", opaque="..."

 

<?xml version="1.0" encoding="utf-8" ?>

<D:acl xmlns:D="DAV:" xmlns:F="http://www.example.com/privs/">

  <D:ace>

      <D:principal>

        <D:href>http://www.example.com/users/ejw</D:href>

      </D:principal>

      <D:grant><D:write/></D:grant>

  </D:ace>

</D:acl>

 

>> Response <<

 

HTTP/1.1 403 Forbidden

Content-Type: text/xml; charset="utf-8"

Content-Length: xxx

 

<?xml version="1.0" encoding="utf-8" ?>

<D:error xmlns:D="DAV:">

  <D:no-inherited-ace-conflict xmlns:D="DAV:"/>

</D:error>

8.1.5           Example: ACL method failure due to an attempt to set grant and deny in a single ACE.

In this example, user "ygoland", authenticated by information in the Authorization header, tries to change the access control list on the resource http://www.example.com/diamond/engagement-ring.gif. The ACL request includes a single, syntactically and semantically incorrect ACE, which attempts to grant the group identified by the URL http://www.example.com/users/friends DAV:read privilege and deny the principal identified by URL http://www.example.com/users/ygoland-so (i.e., the user "ygoland-so") DAV:read privilege. However, it is illegal to have multiple principal elements, as well as both a grant and deny element in the same ACE, so the request fails due to poor syntax.

>> Request <<

 

ACL /diamond/engagement-ring.gif HTTP/1.1

Host: www.example.com

Content-Type: text/xml; charset="utf-8"

Content-Length: xxxx

Authorization: Digest username="ygoland",

   realm="users@foo.org", nonce="...",

   uri="/diamond/engagement-ring.gif", response="...", opaque="..."