fix: default ACL to full access when remote server omits privilege info#81
fix: default ACL to full access when remote server omits privilege info#81stephan1827 wants to merge 1 commit into
Conversation
SebastianKrupinski
left a comment
There was a problem hiding this comment.
This is already implemented in a different place
In the remote collection conversion code.
|
Thanks for the pointer! I'm aware of the elseif branch in RemoteEventsService / RemoteContactsService that tries to infer {DAV:}all when the owner matches the authenticated principal — that was my first thought too. The problem is that the comparison doesn't hold for Fastmail (and likely other servers): {DAV:}owner in a collection PROPFIND response comes back as an absolute URL (e.g. https://caldav.fastmail.com/dav/principals/user/me@fastmail.com/), while getPrincipalUrl() returns the relative path stored during discovery (e.g. /dav/principals/user/me@fastmail.com/). Strict string equality fails, so the else branch fires and permissions ends up as []. With empty permissions, getACL() currently falls back to ['{DAV:}read'], which causes Sabre's ACL plugin to reject any PROPPATCH (rename, recolor) with a 403 — the bug this PR addresses. The cleanest fix for the root cause would be to normalize URLs before comparing in RemoteEventsService/RemoteContactsService, but that would be a separate change and doesn't help the collections already stored with permissions = [] in the database. This PR fixes it at the getACL() layer, which is the point where Sabre actually enforces permissions and where the fallback semantics are clear: if we have no ACL info, treat the calendar as fully accessible to its owner. Happy to adjust the approach if you'd prefer a URL normalization fix instead, or a combination of both. |
86c8c07 to
f80b0f7
Compare
|
Fastmail/Cyrus IMAP does not include {DAV:}acl in PROPFIND responses for
calendar and address-book collections. This left permissions as [] in the
local DB, causing EventCollection and ContactCollection to return only
{DAV:}read from getACL(). Sabre's ACL plugin then rejected PROPPATCH
requests with 403, which the Nextcloud Calendar widget surfaced as
"Kalendername oder -farbe konnte nicht gespeichert werden."
Default to {DAV:}all when no ACL information is available, since these are
the authenticated user's own synchronized collections.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f80b0f7 to
7bf1175
Compare
Summary
{DAV:}aclin PROPFIND responses for calendar and address-book collections.permissionsas[]in the local DB, causingEventCollectionandContactCollectionto return only{DAV:}readfromgetACL().{DAV:}allwhen no ACL information is available from the remote server, since these are the authenticated user's own synchronized collections.Test plan