开发者

WebDav detect write permission on folder

What command do we use on a WebDAV resource (such as a folder or fi开发者_JS百科le) to check if the user has 'write' or 'read-only' permission for that particular resource?


'Plain webdav' doesn't have a way to get this information, other than trying the request and see if it fails.

CalDAV servers tend to have support for WebDAV ACL. (although not all of them though). If they do, you can find out what kind of permissions you have by requesting the current-user-privilege-set property using PROPFIND.

PROPFIND /url HTTP/1.1
Host: blabla

<?xml version="1.0"?>
<propfind xmlns="DAV:">
   <prop>
      <current-user-privilege-set />
   </prop>
</propfind>

The above request is completely from memory, so there might be mistakes.

Hope this helps,

Evert


The WebDAV ACL scheme is documented in RFC3744; the previous post is the correct direction to go. Privileges are described in the RFC.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜