SocialluxSociallux
Toggle navigation menu
Docs navigationv

Primitive

access.grant

BETA

Short name: grant

Version: 1.0.0

Issue an access grant on a record (atom/verb/lexeme/pixel). The grant widens access for actors matching its rule. Caller must be able to manage the subject.

Back to primitive library

Inputs

KeyTypeRequiredDescription
actionstringtrueAction the grant authorizes.
effectstringfalse'allow' (default) widens access; 'deny' overrides everything for matching actors, including owner and admin.
expiresAtstringfalseISO 8601 expiration. Omit for no expiry.
fieldTagstringfalseOnly for action 'field.read': the ACL tag this grant unlocks ('*' for all tagged fields).
publicbooleanfalseRequired opt-in to issue an ALLOW grant with no rule (grant the action to EVERYONE). Without a rule and without public:true, the grant is rejected so 'public' is never an accident.
purposestringfalseFree-text purpose, carried into the audit trail.
ruleobjectfalseMatcher predicate over the access context (e.g. {"actor.userId":"..."} or {"actor.role":"..."}). Omit only for a deliberate public grant (see `public`).
subjectIdobjectIdtrueId of the record the grant governs.
subjectTypestringtrueKind of record the grant governs.

Outputs

KeyTypeRequiredDescription
grantobjectfalseSummary of the created grant: { id, subjectType, subjectId, action }.