Skip to content

Claim

A claim is the core unit of authorization in the Samna platform. Claims represent permissions with specific access levels and are assigned to users, scoped to organizations and locations.

Access Levels

Claims use a numeric access level system where lower numbers grant more access.

LevelNameWhat it grants
0SystemSystem only operations
1OwnerTop level ownership
2AdminCreate, update, and delete
3WriteCreate and update with limited delete
4UpdateUpdate with inheritance
5ActionRead plus specific actions
6ReadRead only access
7MemberClaim membership without resource access
8GuestExternal or temporary read access

Claim Types

TypePurpose
SystemBuilt in claims managed by the platform
UserCustom claims created by administrators
ExternalClaims originating from external identity providers

User Claims

A user claim is the assignment of a claim to a user. Assignments can have temporal constraints with start and end dates, allowing time limited access. Each assignment tracks the reason it was granted.

Claim Objects

Claims are scoped to objects like organizations and locations through claim objects. When a claim is linked to a building, the access level cascades down to all floors and rooms within it. This inheritance means a single claim assignment can grant access across an entire location hierarchy.

Evaluation

When a service checks authorization, it evaluates the user's claims against the requested resource. The system resolves inheritance, checks temporal validity, and returns the effective access level. All reads are indexed lookups for performance.