SSyncropel Docs

Scopes & permissions

The list of scopes, per-thread and per-namespace access, grant limits, how authority is traced, and the membership routes with who can see what.

The scope list

Scopes come from a fixed list. A credential keeps the scopes it had when it was issued; changing a service account's scopes affects newly minted tokens, not existing ones.

ScopeGrants
records:readGET /v1/records, GET /v1/threads/*, and other read surfaces
records:writePOST /v1/records and other write surfaces
threads:writePOST /v1/threads, DELETE /v1/threads/{id}
federation:manageAll /v1/sync/*, /v1/federation/*, /v1/discovery/*
config:readGET /v1/config/*
config:writePOST /v1/config/*
adminEverything, including service-account, token, invite, and membership mutations

The invite presets resolve to scope sets: reader → records:read; contributor → records:read + records:write; admin → admin. Discover them at GET /v1/scope_presets or spl invite presets.

Access to one thread or namespace

A credential's scopes can also include entries that narrow access to a single thread or namespace:

thread:<thread_id>:read
thread:<thread_id>:write
namespace:<ns>:read
namespace:<ns>:write

With such a credential, the broad scope check passes and a second check then allows only the named thread or namespace. This lets you issue a credential that reads exactly one thread. The limit applies to reading (listings, records, calculated views, the live feed) as well as writing.

Grants: limits, narrowing, and chain

A membership or delegation grant (core.identity.grant.v1) carries more than scopes:

Limits

LimitMeaning
max_depthHow many levels of delegation may exist below this grant. 0 means this grant may not issue children.
max_fanoutHow many direct child grants this grant may issue.
budgetA spend ceiling for work performed under this grant.

Narrowing rules

A child grant must be no broader than every parent it cites. A broader grant confers nothing:

  • The child's scopes must be the same as, or fewer than, the parent's.
  • Each limit (max_depth, max_fanout, budget) must be no looser than the parent's effective limit, which is the strictest one along the chain. Loosening a limit, or dropping one the parent has, invalidates the grant.
  • An ancestor's max_depth covers everything below it: a grant deeper than that allows is not in force.
  • A parent with max_fanout = f honors only its first f children.
  • Every grant needs an expires_at, checked against the real time whenever it is used, and there is a maximum lifetime.

A child can never get more than its parent holds. To widen access, you need a new grant from someone who holds the wider authority. One caution: if a capability has a guard expression, a child that swaps in a different guard is refused, because there is no reliable way to tell whether a different guard is narrower.

Chain

Every grant names its chain: the ordered list of ancestor grant ids back to the first grant. The workspace checks the chain against the record's actual parents before accepting the grant, and refuses one that claims an ancestry its parents don't support. A chain can be at most 64 grants long.

The chain lets you trace who gave whom authority. It also stops anyone judging their own work: the worker and the reviewer are each traced back to a person, and a delegate cannot judge work done by the person it acts for.

Revoked and expired grants

For a credential issued under a grant, every request checks that the grant is still valid. A revoked grant (its own, or any grant above it in the chain) answers 401 GRANT_REVOKED. An expired one answers 401 GRANT_EXPIRED. Older credentials with no parent grant are checked on scope and actor alone. See the authorization model.

Membership routes

MethodPathScopeNotes
GET/v1/membersrecords:readOwn row only: admin sees the full roster; any other caller sees only their own row.
POST/v1/members/adoptadminAdopt an existing actor (or a service account's holder, with sa_id) as a principal.
DELETE/v1/members/{label}records:writeRevoke a membership and every credential issued under its grant. The caller must be an admin or the member being revoked: a member can always end their own membership, and no other member can end someone else's. An optional JSON body {"note": "..."} is saved with the revocation. Safe to repeat.

Self routes

MethodPathScopeNotes
GET/v1/selfnone (credential required)Answers about the caller, so it needs a valid bearer but no scope. A guest bearer with no scopes can call it.
POST, GET/v1/self/bindingsnone (credential required)Add or list the caller's own proofs for getting a new credential.
DELETE/v1/self/bindings/{id}none (credential required)Remove one of the caller's own bindings.
GET/v1/self/credentialsnone (credential required)Every active bearer that signs in to this instance as the caller.
DELETE/v1/self/credentials/{bearer_id}none (credential required)Revoke one of the caller's own bearers. The grant stays.
POST/v1/recredentialnone (no bearer)The proof in the body is the credential. A refusal is always the same 401 RECREDENTIAL_REFUSED answer. Requests are rate limited per person and per IP address.

Membership invites are issued through the invite endpoints: POST /v1/invites with a membership envelope. See the API reference.

Who sees what: roster and grants

Two reads answer differently depending on the caller:

  • GET /v1/members. Admin: all rows. Everyone else: only the row where they are the member.
  • GET /v1/folds/grant (the graph of grants). Admin: the full graph. Everyone else: only grants where they are the issuer (iss) or the audience (aud).

This is intended: a non-admin caller who gets one row back has received the complete answer for them. Don't treat a short list as cut off.

On this page