Type Alias ProtocolActionRule

ProtocolActionRule: {
    can: string[];
    of?: string;
    role?: string;
    who?: string;
}

Rules defining which actors may access a record at the given protocol path. Rules take three forms, e.g.:

  1. Anyone can create. { who: 'anyone', can: ['create'] }

  2. Author of protocolPath can create; OR Recipient of protocolPath can write. { who: 'recipient' of: 'requestForQuote', can: ['create'] }

  3. Role can create. { role: 'friend', can: ['create'] }

Type declaration

  • can: string[]

    Array of actions that the actor/role can perform. See {ProtocolAction} for possible values. 'query' and 'subscribe' are only supported for role rules.

  • Optionalof?: string

    Protocol path. Must be present if who === 'author' or 'recipient'

  • Optionalrole?: string

    The protocol path of a role record type marked with $role: true. Mutually exclusive with who

  • Optionalwho?: string

    May be 'anyone' | 'author' | 'recipient'. If who === 'anyone', then of must be omitted. Otherwise of must be present. Mutually exclusive with role