add( )


Sets a permissions handler for a specific channel or resource.

Adding a handler to a channel without specifying a resource applies the handler to the channel and to any of its resources that don't have their own handler. Learn more about permission resolution.

Method Declaration
Copy
Method Parameters
channelChannelRequired

Channel or resource to set a permissions handler for.


handlerfunctionRequired

handler(channel: Channel, subscriber: Subscriber): Promise<{read: boolean}> | {read: boolean} Handler to run when checking permissions for the specified channel.

Errors

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

Did this help?