Skip to main content

Papertrail

A document tool whose whole permission model is relationships: owners, editors and viewers, folders that pass access down, and links that anyone can open.

ApplicationPlanned
This example is planned. Not built yet. This page is the specification for the example.
Works with
JavaScript / TypeScriptPythonReactFastAPI
Stack
React app, FastAPI documents API

Scenario​

A team writes documents in folders. Sharing a folder shares everything in it. A group can be a viewer. A panel next to each document draws who can see it and why, and replays the check for any person that you pick.

People and agents​

WhoRole in the applicationIdentity in LumoAuth
AuthorCreates and shares.A user. The owner of what they create.
TeammateReads or edits.A user, or a member of a group.
GuestOpens a shared link.Signs in with a magic link.

Flows​

FlowWhat happensWhat LumoAuth does
CreateAn author creates a document in a folder.The API writes two tuples: the owner, and the parent folder.
ShareThe author shares the folder with a group.One tuple. Every document in the folder is now visible to the group.
CheckA teammate opens a document.The API asks whether this person is a viewer of this document.
ExplainThe panel shows why.expand returns the path: member of the group, viewer of the folder, parent of the document.
GuestThe author sends a link to an outside person.The guest signs in with a magic link and receives the viewer relation.

Parts​

PartBuilt withJob
AppReact, @lumoauth/reactDocuments, the share dialog, the relationship panel.
APIFastAPI, lumoauth[fastapi]Documents and tuples. Each handler checks before it answers.

What the seed script creates​

  • A namespace for documents and folders.
  • Three users and one group.
  • A few folders and documents with their tuples.

Walkthrough​

  1. Sign in as the author and share a folder.
  2. Sign in as a teammate, and open a document in it.
  3. Open the panel, and replay the check for a third person.
  4. Remove the share, and reload.

Before you run it​

  • Check that your plan includes fine-grained authorization in the plans matrix.