我正在创建一个 PHP 应用程序,它将事件写入 CalDAV 日历(Kolab 组件)。为此,我要求相应用户的日历主页集。之后,我只想使用我有写入权限的日历。我很可能收到了只允许我阅读的共享日历。那么,在注册活动并收到错误消息之前,如何确定日历的访问权限?
提前致谢。
我正在创建一个 PHP 应用程序,它将事件写入 CalDAV 日历(Kolab 组件)。为此,我要求相应用户的日历主页集。之后,我只想使用我有写入权限的日历。我很可能收到了只允许我阅读的共享日历。那么,在注册活动并收到错误消息之前,如何确定日历的访问权限?
提前致谢。
要获得 CalDAV(/*DAV) 资源/收集权限,您可以{DAV:}current-user-privilege-set
在检索日历列表时查询属性。
这是RFC 3744 (WebDAV ACL)的一部分。来自 RFC 的示例:
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="users@example.com", 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>
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>