Member Junction
    Preparing search index...

    Sharing engine. Public methods follow MJ PascalCase convention; private helpers are camelCase. Mirrors the structure of ListOperations.

    Index

    Constructors

    Methods

    • Accept 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.

      Parameters

      • token: string

      Returns Promise<AcceptInvitationResult>

    • 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.

      Parameters

      • args: { Email: string; ListID: string; Role: "Editor" | "Viewer"; TtlMs?: number }

      Returns Promise<InviteResult>

    • 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.

      Parameters

      • listId: string

      Returns Promise<SharePermissionLevel | null>

    • 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.

      Parameters

      • permissionId: string

      Returns Promise<ShareResult>