Repository navigation
#2353: a Microsoft 365 group's calendar opens by its address, read-only - #2387
Draft
ChrisFontanini wants to merge 3 commits into
Draft
ChrisFontanini wants to merge 3 commits into
ChrisFontanini wants to merge 3 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Graph refuses /users/{group}/calendar and /users/{group}/mailFolders
with 403 ErrorGroupIsUsedInNonGroupURI. Open Shared Calendar took that
403 for a person who hadn't shared, and Add Shared Mailbox for an
ordinary error tried again at every Send/Receive. Both now go by the
code, whatever the status: OpenedWhy::IsGroup and SharedRefusal::IsGroup,
said in the dialog as a group MailCraft can't open yet (UCSLabs#2353).
Human-reviewed, AI-assisted, nobody's mailbox harmed.
ChrisFontanini
force-pushed
the
feat/2353-group-calendars
branch
from
December 5, 2026 19:42
e9f0e04 to
b7ec4fe
Compare
…the comments The three new texts get a draft translation in every catalogue, marked fuzzy. The comments that describe telling a group's address apart cite UCSLabs#2360, and say that reading a group is UCSLabs#2353. Human-reviewed, AI-assisted, nobody's mailbox harmed.
…read-only
Open Shared Calendar takes a group's address. Graph refuses it at
/users/{address} (ErrorGroupIsUsedInNonGroupURI); the calendar job then
asks for a token with Group.Read.All by itself, looks the group up by
its address (a unified one only), and reads its calendar at
/groups/{id}/calendar. The group's id is kept with the address, so later
jobs read it there directly. The calendar can only be read, and its
events remind nobody. Without the permission (an administrator gives
it) the calendar waits on the list and the window says why.
Group.Read.All is in the administrator's approval with the rest and on
no sign-in's page.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
ChrisFontanini
force-pushed
the
feat/2353-group-calendars
branch
from
December 5, 2026 23:51
b7ec4fe to
8163d85
Compare
|
This branch has not been deployed
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.



Builds on #2361 (only the last commit is new here; this stays a draft until #2361 is merged).
Part of #2353: reading a Microsoft 365 group's calendar under
Group.Read.All. Writing (Group.ReadWrite.All) is not in this pull request.What changes for the person using MailCraft
Open Shared Calendar takes a Microsoft 365 group's address. The group's calendar appears under Shared Calendars, read-only, with its events, and without the reminder Exchange puts on every group event. The dialog's label now says "person or Microsoft 365 group".
Until the organisation's administrator has given
Group.Read.All, the calendar stays on the list and the dialog says why: "team@example.org is a Microsoft 365 group. Its calendar opens once your organisation's administrator allows MailCraft to read groups (Group.Read.All); it waits on your list until then." Once the permission is given, the next listing reads it.How it works:
/users/{address}(403ErrorGroupIsUsedInNonGroupURI, A Microsoft 365 group's address in Open Shared Calendar or Add Shared Mailbox says no access, or tries again forever #2360). Only then does the calendar job ask for a token of its own withGroup.Read.Alland the sign-in scopes. It is never on a sign-in's page, never in the one question, and never asked for when there is no group. It looks the group up withGET /groups?$filter=mail eq '…'(unified groups only, the address must match), and reads/groups/{id}/calendarand/calendar/calendarView.OpenedCalendar.group, a validated GUID), so later jobs read the group directly and never ask at its address again.Rights::Read, whatevercanEditsays.Unreachable, not "has no calendar".Questions for the owners
The administrator's approval.
Group.Read.Allis added toadmin_scope(), following the rule indocs/mail-privacy-rules.mdthat one approval covers everything the program asks for. That means an administrator approving MailCraft also approves reading groups, before anyone opens one. Is that what you want, or should it stay out of the general approval and be approved only when a group is opened?Listing groups automatically. Outlook shows the groups you belong to without adding them. This PR keeps to what you approved: a group is read only once someone opens it by address. Listing groups could come next, in one of two ways:
/me/memberOf, whichGroup.Read.Allcovers) unticked, like a shared mailbox's calendars (Shared mailboxes through Microsoft Graph (asks for three new permissions) #70), and a group is read once ticked.Either way the address box stays, for groups you can read but don't belong to. Would you take either, and which?
How it was checked
New tests:
net graph::group_calendar_tests: lookup with OData quoting, non-unified groups and missing permission; reading at/groups/{id}only, read-only even when the stand-in sayscanEdit: true; events without reminders; hostile ids ask nothing.host graph::run::groups_tests: a first open asks the groups' token once and reads at the group; waits without permission; a known group is never asked at its address; a distribution list stays refused; people alone and unticked groups ask no groups' token; a refused groups' token leaves the job's own.engine calendar_opened_tests: the group's id kept and waiting for permission; late events neither bring back a removed calendar nor create one.oauth::tests: exact scope of the groups' token, consent errors.ui open_shared_tests: the new wording.cargo xtask ci: all 15 steps passed (Linux,rust:latestcontainer, Mesa's software Vulkan for the rendering tests).ui_shotwith{"host": {"graph": "openedGroup"}}: the waiting message, light and dark.On a real tenant, as a member of a unified group, after an administrator granted
Group.Read.Allto the application: a Windows build of this branch opened the group's calendar under Shared Calendars, with its events, in the calendar view and in overlay. Before that, the network code was run against the live service read-only (lookup, calendar, about 200 events over three months, none with a reminder).cargo xtask cipassesA crash or data-loss fix has its regression test (late events creating or reviving a calendar opened by address: tested in
calendar_opened_tests)"Allow edits by maintainers" is ticked (the box beside Create pull request)
I have signed the CLA, or will by commenting on this pull request
Human-reviewed, AI-assisted, nobody's mailbox harmed.