我正在创建一个PHP应用程序,它将把事件写入CalDAV日历(Kolab groupware)。为此,我请求相应用户的日历主页集。在此之后,我只想使用我有写权限的日历。很可能我收到的共享日历只允许我阅读。那么,在注册事件并接收错误消息之前,如何确定对日历的访问权限?
提前谢谢。
发布于 2019-07-20 20:15:39
要获得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>https://stackoverflow.com/questions/57116267
复制相似问题