Sharing Patterns
Direct user sharing, team-based sharing, and permission levels
Overview
LinkedRecords provides flexible sharing mechanisms ranging from direct user sharing to team-based access control. This guide covers various sharing patterns and when to use each.
Permission Levels
There are two main permission levels:
| Permission | Predicate | Capabilities |
|---|---|---|
| Read-Only | $canRead | View attribute values |
| Read-Write | $canAccess | View and modify attribute values |
Direct User Sharing
Share with a Specific User
The simplest sharing pattern is granting direct access to another user:
getUserIdByEmail only works if the user has logged in to your application at
least once. They must be signed up in your LinkedRecords backend before you can
look up their ID by email.
Revoke Direct Access
Team-Based Sharing
Share with a Team
Grant access to a team, and all members inherit that access:
Share an Existing Attribute with a Team
Different Access Levels for Different Teams
Sharing with Fact Permissions
Beyond reading and writing attribute values, you can share the ability to create facts about an attribute:
Allow Creating Facts with Attribute as Subject
Allow Creating Facts with Attribute as Object
Organization Sharing Pattern
A complete sharing setup for an organization:
User-Initiated Sharing
Implement a share button in your UI:
Sharing via Team Membership
Another approach is adding users to teams rather than sharing individual items:
Team-based sharing is more scalable - users automatically get access to all team resources without individual sharing operations.
List Shared Items
Query for items shared with you:
Sharing Best Practices
-
Use teams for groups - Easier to manage than individual permissions
-
Use accountability for billing - Transfer accountability to organizations for quota management
-
Implement unsharing - Always provide a way to revoke access
Common Gotchas
User Must Exist
Verify Authorization
Removing All Access
When removing a user's access, check for both permission types: