Accountability
Understanding ownership, quotas, and accountability transfer
Overview
Accountability in LinkedRecords determines who "owns" a record in terms of storage quota usage. The accountable party's quota is charged for the storage used by the record.
Automatic Accountability
When you create a record, you automatically become accountable for it:
This means:
- The storage counts against your quota
- You have full control over the record
- You can grant permissions to others
Quota Management
Each user and organization has storage quotas. Check current usage:
Quota includes:
- Storage size for record values
Transferring Accountability
Transfer accountability to an organization so storage counts against the organization's quota instead of the individual:
You can only transfer accountability to groups where you are a member, host, or accountable party. You cannot transfer accountability to individual users.
Accountability Transfer Rules
Exactly one entity can be accountable for a resource at any time. When you create
a new $isAccountableFor fact, the system automatically deletes the previous
accountability fact. This ensures consistent quota tracking - the old accountable
party loses accountability, and the new one takes over.
Valid Transfers
Accountability can be transferred to:
- A group you created
- A group where you're a member or host
- A group that has
$canRefinepermission on your group
Invalid Transfers
These transfers will fail:
- To another individual user
- To a group you have no relationship with
- From yourself (creator accountability can't be deleted)
Organization Accountability Pattern
The recommended pattern for organizations is to make the organization accountable for all shared resources:
Adding Resources to an Organization
When team members create resources, transfer accountability to the org:
Accountability and Access
Accountability is separate from access permissions:
| Concept | Predicate | Purpose |
|---|---|---|
| Accountability | $isAccountableFor | Storage quota, ultimate ownership |
| Read Access | $canRead | Permission to view |
| Read-Write Access | $canAccess | Permission to view and modify |
Finding Accountable Resources
Query for resources you're accountable for:
Cascading Accountability
When you transfer accountability of a group, consider the resources within:
Quota Violation Handling
When quota is exceeded, operations may fail:
Practical Example: Personal vs Organization Storage
Best Practices
-
Transfer accountability to organizations for shared resources to avoid individual quota limits
-
Set up organization accountability in blueprints to ensure consistent quota management
-
Query by accountability to find all resources belonging to an entity
-
Monitor quota usage using
getQuota()to prevent surprises -
Plan quota allocation - decide upfront which entity should be accountable for different types of resources
-
Don't try to delete creator accountability - transfer it instead