Authorization Model
Understanding LinkedRecords' built-in permission system
Overview
LinkedRecords has a unique authorization model where the user who creates data decides who can access it. Instead of centralized access control rules defined in the backend, permissions are expressed as facts in the triplestore.
Core Principle
By default, data you create is private to you. To share data with others, you create facts that grant specific permissions.
Reserved Predicates
All authorization predicates start with $. These are the available predicates:
$isAccountableFor
Indicates ownership and accountability for an attribute. The accountable party is responsible for the storage quota used by the attribute.
When you create an attribute, a $isAccountableFor fact linking you to it is
automatically created. You don't need to add this manually.
$isMemberOf
Grants membership in a group, inheriting the group's access permissions.
Members can:
- Read and write attributes the group has
$canAccessto - Read attributes the group has
$canReadto - Use subjects the group has
$canRefinepermission for - Use objects the group has
$canReferTopermission for
$isHostOf
Grants host privileges for a group. Hosts can invite new members.
Hosts have all member permissions, plus:
- Can add new members to the group (
$isMemberOf) - Can make other users hosts (
$isHostOf) - Can remove members
$canRead
Grants read-only access to an attribute.
$canAccess
Grants read and write access to an attribute.
$canRefine
Grants permission to use an attribute as the subject in facts (conceptor permission).
This allows team members to create facts like [attributeId, 'somePredicate', someOtherAttributeId].
$canReferTo
Grants permission to use an attribute as the object in facts (referrer permission).
This allows team members to create facts like [otherId, 'somePredicate', attributeId].
Permission Hierarchy
Creator Permissions
When you create an attribute, you automatically get full permissions:
- You become accountable for it
- You can read and write it
- You can use it as subject or object in facts
- You can grant permissions to others
Group Permissions
Permissions can be granted to groups (teams), which then flow to all members:
Authorization Rules
Who Can Create Facts?
| Predicate | Who Can Create |
|---|---|
$isATermFor | Anyone (terms are public) |
$isAccountableFor | Auto-created for creator; you can transfer by making another entity accountable for something you're accountable for |
$isMemberOf | Creator or host of the group |
$isHostOf | Creator or host of the group |
$canRead | Anyone accountable for the object |
$canAccess | Anyone accountable for the object |
$canRefine | Anyone accountable for the object |
$canReferTo | Anyone accountable for the object |
| Custom predicates | Anyone with $canRefine on subject AND $canReferTo on object |
Who Can Delete Facts?
Generally, you can delete facts you created or have appropriate authorization over:
- Term facts can only be deleted by their creator
- Membership facts can be deleted by hosts or the member themselves
- Permission facts can be deleted by the accountable party
Practical Examples
Private Data (Default)
Share with a Specific User
Share with a Team
Revoke Access
Security Considerations
Users Cannot Self-Promote
A user cannot grant themselves permissions they don't have:
Members Cannot Invite Others (Only Hosts)
Being a member doesn't grant invitation rights:
Custom Predicates Cannot Start with $
The $ prefix is reserved for system predicates:
Verifying Fact Creation
Since unauthorized fact creations are silently ignored, check the return value: