Features/Sharing
SHARING · STABLE

Sharing is a grant, not a rules file.

Everything starts private. The owner grants read or write to a person, an organization or anyone, on a collection or a single document. Nothing is copied, and the owner can take it back any time.

TO A PERSON Share with someone by ID or handle Pick them from the user's contacts, which follow them across every Bazaar app.
TO AN ORGANIZATION Share with an organization Membership is checked on every request. Remove someone from the organization and their access ends.
TO ANYONE Public to every signed-in user For posts and profiles. Narrow it with a filter so only the documents you mean are public.

Short enough to review. Even if your AI wrote it.

One call, four fields you can read aloud: what, to whom, which access, which documents. No policy language to get subtly wrong.

// Sam can read Ana's trip, nothing else
await bzr.permissions.create({
  collectionName: "trip",
  granteeType: GranteeType.USER,
  granteeId: samId,
  types: [PermissionType.READ],
})
// a link anyone can redeem once
const link = await bzr.permissions.links.create(template)
share(link.url)
A URL that carries a permission Single-use by default, or set a limit. Your app gets an event when someone redeems it: the invite flow for games, lists and clubs.
A paywall is a filter Use "$purchases" in a grant and buyers read what they paid for. Access ends when the purchase does.
Shared data stays realtime Subscribe to a collection someone shared with you and see their changes as they happen.

What a grant can't protect you from.

A grant that's too wide "Anyone can read" on a private collection is still a leak. Review grants like you review code.
An app that misuses what it can read App code runs with the user's sign-in. Bazaar blocks what wasn't granted, not what the app does with what was.
Viewers without an account Every reader signs in with Bazaar. Anonymous reads aren't supported.
OTHER WINDOWS