Checks permissions for a subscriber on a channel or channel resource.
This is a hook, not a method you call directly. Define this function as a named export in a file called realtime-permissions.js in your site's backend. It runs automatically when a site visitor subscribes to a channel.
Important:
{"read": true}.Implement permissions logic in one of the following ways:
permissionsRouter to add permissions logic per channel, then
call permissionsRouter.check() in the body of this function and return
its result.Note: When previewing your site, read permissions are always granted.
Channel, and optionally resource, to check permissions for.
Subscriber to check permissions for.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.