Sharing
Resource sharing built for teams
Give customers per-item sharing across projects, folders, and documents, with team grants, opt-in folder inheritance, expiring access, and accessible React components.
01 · Sharing
Invite by account or verified email
Send recipient-bound invitations that expire automatically. Rolebook rechecks the sender's permissions when an invitation is accepted.
02 · Sharing
Time-limited access that ends automatically
Give contractors or guests access until a specific date. Once that date passes, the membership grants nothing.
- 31 MarRolebook endedAda ParkCan edit · Brand assets
- 1 MarSam Lee gaveAda ParkCan edit until 31 Mar · Brand assets
03 · Sharing
Teams and folder inheritance
Share once with a team or a parent folder. When someone leaves a team, their team access ends on the very next request.
For developers
Share with a team until a date, in one call
@rolebook/sharing checks delegation rules, saves the membership in your database, and writes the audit entry in the same transaction.
Read the docsconst tenant = sharing.forTenant({ tenantId: "acme", actor: { type: "user", id: "sam" } });
// Share Brand assets with the Design team as editors, until 31 March.
await tenant.execute({
kind: "grantRole",
resource: { type: "project", id: "brand_assets" },
subject: { type: "team", id: "design" },
role: "editor",
expiresAt: new Date("2027-03-31T00:00:00Z"),
idempotencyKey: "share-brand-assets",
});
// { ok: true, code: "APPLIED", ... }
const history = await tenant.auditHistory({
resource: { type: "project", id: "brand_assets" },
limit: 50,
});
// newest first, a page at a time