subscribe
Grants a realtime subscribe on the ref-channel of a DataSync entity, user or channel: a pub/sub read on DataSyncNamespace.refChannel (id for the default projection, __{projection}__{id} otherwise). Relationships and memberships have no ref-channel of their own: their events are published to both endpoint refs.
The projection here only selects the ref-channel name. It adds nothing to the token meta. That differs from the projection of entity / channel / user, which sets the REST read view in meta.pn-projections. To both read through and subscribe to a projection, grant the pair:
DataSyncGrant.channel("chat-1", get = true, projection = "admin") // REST reads through "admin"
DataSyncGrant.subscribe("chat-1", projection = "admin") // read on "__admin__chat-1"Content copied to clipboard
Returns a plain ChannelGrant (not a DataSyncGrantType, which has no read bit).
Parameters
projection
null (or "default" / "__default__") for the default projection.
Throws
if projection is blank.