check( )


Checks the permissions for a subscriber on a channel or channel resource.

The resolution chain is:

  1. If a handler exists for the specified channel or resource, it runs and its result is returned.
  2. If no handler exists for the resource, the parent channel's handler runs instead.
  3. If no channel handler exists, the default handler runs.
  4. If no default handler is set, the built-in default permissions are returned: {"read": true}.

Typically, call this method in the body of the realtime_check_permission() function:

Copy
Method Declaration
Copy
Method Parameters
channelChannelRequired

Channel or channel resource to check permissions for.


subscriberSubscriberRequired

Subscriber to check permissions for.

Returns
Return Type:Promise<ChannelPermissions>
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?