Keep sharing to known accounts when directory queries are off #283

Merged
jcoffey-dev merged 1 commits from fix/directory-off-acl-route into main 2026-11-02 01:31:12 +00:00
Owner

Follow-up to #282, which left one route open.

With "Allow Directory Queries" off, a regular user can now add someone to a share only if they already have a connection to them: they're on one of the user's own items, they've shared something with the user, or they're in the same group. Anyone else is refused the same way as an account that doesn't exist. This covers JMAP, WebDAV and IMAP.

Principal/get follows the same list, so a client can put names on the people in a user's own shares. People already on an item can still have their rights changed or be removed.

Upgrade note. This adds to the note from #282. With the setting off, which is the default, regular users can't start sharing with someone new, in any client. Turn the setting on wherever people share freely. Accounts that can list accounts anyway aren't affected.

An IMAP connection keeps the settings it started with, so a change reaches it when it reconnects.

Tested: imap_tests, jmap_tests, webdav_tests, system_tests and sharing_policy_tests locally on RocksDB, with new cases in each path, plus an end-to-end run against the webmail with the setting off and on. The webmail side is in inbuxa-webmail.

Follow-up to #282, which left one route open. With "Allow Directory Queries" off, a regular user can now add someone to a share only if they already have a connection to them: they're on one of the user's own items, they've shared something with the user, or they're in the same group. Anyone else is refused the same way as an account that doesn't exist. This covers JMAP, WebDAV and IMAP. `Principal/get` follows the same list, so a client can put names on the people in a user's own shares. People already on an item can still have their rights changed or be removed. **Upgrade note.** This adds to the note from #282. With the setting off, which is the default, regular users can't start sharing with someone new, in any client. Turn the setting on wherever people share freely. Accounts that can list accounts anyway aren't affected. An IMAP connection keeps the settings it started with, so a change reaches it when it reconnects. **Tested:** `imap_tests`, `jmap_tests`, `webdav_tests`, `system_tests` and `sharing_policy_tests` locally on RocksDB, with new cases in each path, plus an end-to-end run against the webmail with the setting off and on. The webmail side is in inbuxa-webmail.
jcoffey-dev added 1 commit 2026-11-02 00:37:31 +00:00
Keep sharing to known accounts when directory queries are off
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 10m6s
44b0c4d16d
Follow-up to #282. With "Allow Directory Queries" off, a regular user can only
add someone to a share if they already have a connection to that person, and
the refusal is the same whether or not the account exists. Applies to JMAP,
WebDAV and IMAP. Principal/get now also answers for the accounts on the
caller's own shares, so clients can show their names.
jcoffey-dev merged commit a3dbe149ec into main 2026-11-02 01:31:12 +00:00
jcoffey-dev deleted branch fix/directory-off-acl-route 2026-11-02 01:31:12 +00:00
Sign in to join this conversation.