channel

fun channel(name: String, get: Boolean = false, create: Boolean = false, update: Boolean = false, delete: Boolean = false, projection: String? = null): DataSyncGrantType

Grants DataSync REST CRUD on a channel record. The permission bits land in the plain channels bucket, shared with pub/sub and App Context v2: update = true also authorizes App Context v2 setChannelMetadata for the same id.

Parameters

projection

the single projection the token holder looks through for this channel's REST reads, or null for the implicit __default__ projection. Emitted into the token meta as the pn-projections entry datasync:channels:<name>. It does not affect realtime subscribe (see subscribe). A named projection only has an effect for channels of a custom Channel subclass that declares it: the built-in Channel class exposes its fields through __default__ only. parseToken returns it in PNToken.projections.resources.channels (patterns.channels for channelPattern).