This page is the canonical reference for Postbrain access control.
Use it when you need to answer questions like:
- Can this principal do this action in this scope?
- Why does this token fail with
scope access deniedorinsufficient permissions? - Which permission key should a token include?
Every authorization decision is evaluated as:
(principal, resource:operation, scope)
Examples:
memories:readonproject:acme/platform/postbrainscopes:editonteam:acme/platformtokens:deleteoncompany:acme
systemadmin is a special principal-level bypass flag (principals.is_system_admin = true).
Permission keys are {resource}:{operation}.
Resources:
memoriesknowledgecollectionsskillssessionsgraphscopesprincipalstokenssharingpromotions
Operations:
read: view/list/searchwrite: create/update contentedit: structural/config changesdelete: remove entities/content
Shorthand permissions:
read,write,edit,delete
Each shorthand expands across all resources for that operation.
A principal's effective permissions are additive from these sources:
is_system_admin: full access everywhere.- Direct scope ownership: full access on owned scopes and descendants.
- Membership-derived role permissions (
member,admin,owner) on scopes owned by the parent principal. - Direct scope grants via
scope_grantsfor specific permissions on specific scopes.
No source can be used to escalate beyond what the granting principal already has.
Scopes form a parent/child tree.
- Downward inheritance: permissions on scope
Sapply to descendants ofS. - Upward read:
*:readon a child implies*:readon ancestors. - No upward write/edit/delete: child permissions never grant ancestor mutation rights.
Membership roles grant progressively broader permission sets:
member: read/write focused content permissions.admin: adds structural/edit capabilities.owner: adds delete capabilities.
Exact role permission sets are defined in designs/DESIGN_PERMISSIONS.md.
Tokens are downscoped credentials issued on behalf of a principal.
Token effective access on a request is:
- principal effective permission on target scope
- intersected with token declared permissions
- intersected with token scope restrictions (
scope_ids) when present
So a token can never exceed the principal's authority.
Use permissions to limit allowed operations:
- broad read-only:
["read"] - targeted:
["memories:read","knowledge:read"] - mixed:
["memories:read","memories:write","knowledge:read"]
Use scope_ids to limit where token permissions apply:
scope_ids = NULL: any scope the principal can access.scope_ids = [A, B]: onlyA/Band their descendants.
Self-service is always allowed:
- create/list/update scopes/revoke your own tokens
Managing another principal's tokens requires delegated authority:
principals:editon a scope that grants authority over that principal, orsystemadmin
Promotion from memory to knowledge supports two paths:
- Direct-write path:
memories:writeon source scope +knowledge:writeon target scope.
- Promotion-only path:
promotions:writeon source scope without directknowledge:writeon target.
Approval/rejection requires promotions:edit on the target scope.
If access fails:
- Verify target scope is included by token
scope_ids(or unrestricted). - Verify token declares required
{resource}:{operation}. - Verify principal effectively has required permission in that scope via ownership/membership/scope grant.
- Check whether request targets ancestor scope and assumes upward write/edit/delete (not allowed).