Tiptap Collaboration and General Authorization Policies #77
calebbourg
started this conversation in
New Feature Design
Replies: 1 comment
-
|
@calebbourg Your proposal looks great, thank you for proposing it. Adding some flow charts to your original proposal to help us visualize it. Some follow-up questions I have:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Tiptap
Tiptap requires 2 pieces of information to successfully load an existing document:
name: An arbitrary string, which uniquely identifies a documentnamecan take any string value. Values likejim-caleb-1, orjim/{UUID}or{UUID/UUID}are all validtoken: A signed JWT which includes information describing which documents the holder (user) of the JWT can accesstokencan include aallowedDocumentNamesfield which is an array of documentnames for which the holder of the JWT can access.allowedDocumentNamessupports wildcard patterns. Ex.jim-caleb/*which would allow the holder of the JWT to access all documents that have names that start withjim-caleb/Ex.jim-caleb/{coaching_session_id}General Authorization Policies
We can categorize all current resources represented in the system into 3 groups:
Other things to note:
noteis created by a User in the context of a Coaching Relationship within an Organizationnotes for their personal use within the platform.Proposal
General
visibilityenum with (to start) variantsSelf,coaching_relationship, andorganizationvisibility: Selfwill be considered private and only accessible by the User that created the resource.visibility: coaching_relationshipwill be accessible to each User associated with thecoaching_relationshipto which the resource belongs.visibilityofcoaching_relationshipTiptap
noteor acoaching_sessionbut not directly associated with both.slugcolumn toorganizationsandcoaching_relationshipstables.slugs and terminated with the UUID of the owning resource. Ex{organization_slug/{coaching_relationship_slug}/{note_UUID}allowedDocumentNames: ["jim-hodapp-coaching/jim-caleb/*"]which would allow Caleb access to all Tiptap documents associated with thejim-calebCoaching RelationshipDiagrams
General
flowchart TD A[Start] --> B["User attempts to access a resource"] B --> C{"Evaluate permissions"} C --> |Creator?| D{"Is User the Creator?"} D --> |Yes| E["Grant read/write access"] D --> |No| F{"Is User a Coach or Coachee in related Coaching Relationship?"} F --> |Yes| G["Grant read access"] F --> |No| H{"Check resource visibility"} H --> |"Self"| I{"Is User the Creator?"} I --> |Yes| J["Grant access"] I --> |No| K["Deny access"] H --> |"coaching_relationship"| L{"Is User in related Coaching Relationship?"} L --> |Yes| M["Grant access"] L --> |No| N["Deny access"] H --> |"organization (future)"| P{"Is User in Organization?"} P --> |Yes| Q["Grant access"] P --> |No| R["Deny access"]TipTap
flowchart TD subgraph "JWT Generation" A[User changes Coaching Relationship] --> B[Generate new Tiptap JWT] B --> C[Encode full permissions for current Coaching Relationship] end subgraph "Document Creation" C --> D[Create document name prefix] D --> E["{organization_slug}/{coaching_relationship_slug}/"] E --> G[Append resource UUID to document name] H --> F["{organization_slug}/{coaching_relationship_slug}/{{resource_type}_UUID}"] G[Create Tiptap document] --> H[Associate with single Refactor resource] end subgraph "Access Control" J[User attempts to access Tiptap document] --> K{Check JWT permissions: matches Coaching Relationship e.g.: 'jim-hodapp-coaching/jim-caleb/*'?} K --> |Yes| L[Grant access] K --> |No| M[Deny access] end subgraph Example: Caleb's JWT N[Start] --> O["allowedDocumentNames: ['jim-hodapp-coaching/jim-caleb/*']"] O --> P[Caleb can access all documents in jim-caleb Coaching Relationship] endBeta Was this translation helpful? Give feedback.
All reactions