Optionalprovider: IMetadataProviderAccept an invitation by its token. The caller becomes the recipient
(we read contextUser); the invitation's email must match the
caller's email — protects against token interception by a different
MJ account.
On success: creates the MJResourcePermission and marks the
invitation Accepted.
Return all lists currently shared with the context user. Role-based shares are deferred to a future iteration — Phase 2 ships with direct user-level shares only.
Return the current (non-revoked) shares for a list — both user and
role grants, mapped into the canonical ListShareSummary shape.
Send an email invitation to share a list with someone — who may or
may not already have an MJ user account. We persist the invitation
with a random token + expiry; the recipient later calls
AcceptInvitation(token) to promote it into a real
MJResourcePermission.
Resolve the effective permission level the context user has on a
list. Returns 'Owner' if they created the list (UserID match);
otherwise checks for a direct user share. Role-based shares are
resolved by ResourcePermissionEngine server-side — we return null
here to indicate "no direct share" and let the caller fall back if
needed. Phase 2 ships with direct user-shares only.
Revoke a pending invitation. No-op if already accepted (the resulting
permission can still be Unshared separately).
Grant a direct share on a list to a user or role. Idempotent at the (list, target) level — re-sharing the same target updates the existing permission row's level rather than creating duplicates.
Revoke a previously-granted permission. We soft-revoke (Status =
'Revoked') rather than hard-delete so the audit trail stays
meaningful — GetSharesForList filters out revoked rows by default.
Sharing engine. Public methods follow MJ PascalCase convention; private helpers are camelCase. Mirrors the structure of
ListOperations.