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.
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
| Who | Role in the application | Identity in LumoAuth |
|---|---|---|
| Author | Creates and shares. | A user. The owner of what they create. |
| Teammate | Reads or edits. | A user, or a member of a group. |
| Guest | Opens a shared link. | Signs in with a magic link. |
Flows
| Flow | What happens | What LumoAuth does |
|---|---|---|
| Create | An author creates a document in a folder. | The API writes two tuples: the owner, and the parent folder. |
| Share | The author shares the folder with a group. | One tuple. Every document in the folder is now visible to the group. |
| Check | A teammate opens a document. | The API asks whether this person is a viewer of this document. |
| Explain | The panel shows why. | expand returns the path: member of the group, viewer of the folder, parent of the document. |
| Guest | The author sends a link to an outside person. | The guest signs in with a magic link and receives the viewer relation. |
Parts
| Part | Built with | Job |
|---|---|---|
| App | React, @lumoauth/react | Documents, the share dialog, the relationship panel. |
| API | FastAPI, 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
- Sign in as the author and share a folder.
- Sign in as a teammate, and open a document in it.
- Open the panel, and replay the check for a third person.
- Remove the share, and reload.
Before you run it
- Check that your plan includes fine-grained authorization in the plans matrix.