Repository navigation
Conversation
The free-busy lookup read the recipient's calendar-home-set and schedule-inbox-URL through the ACL, which lets only the principal itself (or an admin) read them, so every request from another user answered 3.7. Look them up with the ACL propFind listener removed, as local delivery already does; the schedule-query-freebusy check still decides access. Fixes sabre-io#1185
Author
|
A downstream data point: Baikal is working around the same bug on its own side in sabre-io/Baikal#1406. It grants the organizer temporary That is the same conclusion this PR reaches, that free-busy between users of one server should work without extra configuration, but it has to be re-implemented in each downstream project (it subclasses both the principal backend and the scheduling plugin). If the default here is deliberate, a note in the docs on where to hook in would probably save that work; if not, the inbox privilege already expresses it. |
The principal lookup now ignores the ACL, so add a test that an inbox granting only schedule-deliver-invite and schedule-deliver-reply refuses the free-busy query with NeedPrivileges. Also wrap the comment in getFreeBusyForEmail() to 80 columns.
thilo
force-pushed
the
fix-freebusy-principal-acl
branch
from
September 11, 2026 22:01
ec87081 to
c3c38e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1185 (also reported as #1601 and sabre-io/Baikal#1360).
Problem
A free-busy request (POST to the outbox) for another user on the same server
answers
3.7;No calendar-home-set property foundunless the requester is anadmin.
getFreeBusyForEmail()finds the recipient withprincipalSearch(),which reads
calendar-home-setandschedule-inbox-URLthrough the ACL. Aprincipal is readable only by itself (
{DAV:}allfor{DAV:}owner), so forany other user the properties come back 403. With
hideNodesFromListingsthelookup also triggers an
Undefined array key 0warning inprincipalSearch().The existing tests pass because they make the requesting user an admin first.
Change
Run the lookup with the ACL
propFindlistener removed, the same wayscheduleLocalDelivery()already looks up the recipient's inbox, and put itback in a
finally.Privacy
This was proposed in #1185 before, and @evert
declined it
for privacy reasons: the default should not let everyone read everyone's
information. I think the change keeps that default, because the principal ACL
is not what decides free-busy access:
calendars. They are not sent to the client.
schedule-query-freebusycheck on the recipient's inbox, which comes right after the lookup. RFC 6638
defines that privilege on the scheduling inbox for this purpose. If the check
fails,
checkPrivileges()throwsNeedPrivilegesand the request fails with403
(raised by @m-a-v,
now covered by a test).
Schedule\Inbox::getACL()already grantsschedule-deliver, whichincludes
schedule-query-freebusy, to{DAV:}authenticated. The inboxalready allows the query, and the principal ACL blocked it before that
check was reached.
answers
3.7;Could not find principalfor unknown addresses and3.7;No calendar-home-set property foundfor known ones.This is a behaviour change: on a default setup, authenticated users can now
query each other's free-busy, as the inbox ACL says they may. To keep
free-busy private, restrict the inbox instead of the principal: grant
schedule-deliver-inviteandschedule-deliver-replyrather thanschedule-deliver. Invitations keep working and free-busy queries are refused.testFailWithoutFreeBusyPrivilegedoes exactly that.If you'd rather keep the old behaviour as the default, I can put this behind
an opt-in property on the Schedule plugin instead.
Tests
testSucceedWithoutAdminandtestSucceedWithoutAdminWithHiddenNodesinFreeBusyRequestTestrepeattestSucceedwithout the admin shortcut, oncewith and once without
hideNodesFromListings. Both fail on master and passwith the change. They also check that the ACL is active again afterwards.
testFailWithoutFreeBusyPrivilegerestricts the recipient's inbox asdescribed above and expects
NeedPrivileges. It fails if theschedule-query-freebusycheck is removed.tests/Sabre/CalDAV/Schedulepasses exceptSchedulingObjectTest::testGetLastModified, which errors on master too(PHP 8.3
ctype_digit()deprecation).Found running Davis (sabre/dav 4.7.1) with macOS Calendar, which shows "There
was a problem accessing availability" when an event has attendees on the same
server.