group memberships for the calendar-proxy-{read,write} pseudo-principal are always empty

Only regular principals can be members in any groups, for
pseudo-principals group membership doesn't make sense. In case somebody
asks, do not return the group memberships of the parent principal but
rather provide an empty answer.
This commit is contained in:
Florian Schlichting 2017-05-01 21:05:47 +02:00
parent 8c5101c185
commit 7e3a9a476f
2 changed files with 7 additions and 11 deletions

View File

@ -501,6 +501,10 @@ class DAVPrincipal extends Principal
case 'http://calendarserver.org/ns/:group-membership':
case 'DAV::group-membership':
if ( $request->IsProxyRequest() ) {
/* the calendar-proxy-{read,write} pseudo-principal should not be a member of any group */
return false;
}
$reply->DAVElement( $prop, 'group-membership', $reply->href($this->GroupMembership()) );
break;

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "5712eb30f86b6a9755a688c43b4bb763"
Content-Length: 1477
ETag: "5379cc33938a9b800403f94bdfec0571"
Content-Length: 1091
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -23,15 +23,6 @@ Content-Type: text/xml; charset="utf-8"
<href>/caldav.php/user1/</href>
<href>/caldav.php/assistant1/</href>
</group-member-set>
<group-membership>
<href>/caldav.php/assistant1/</href>
<href>/caldav.php/teamclient1/</href>
<href>/caldav.php/user1/</href>
<href>/caldav.php/user1/calendar-proxy-read/</href>
<href>/caldav.php/assistant1/calendar-proxy-read/</href>
<href>/caldav.php/resource1/calendar-proxy-read/</href>
<href>/caldav.php/resource2/calendar-proxy-read/</href>
</group-membership>
<C:calendar-proxy-read-for>
<href>/caldav.php/user1/</href>
<href>/caldav.php/assistant1/</href>
@ -45,6 +36,7 @@ Content-Type: text/xml; charset="utf-8"
<propstat>
<prop>
<C1:calendar-description/>
<group-membership/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>