grant
Deprecated
This function is deprecated. Use the grantToken(ttl, meta, authorizedUUID, channels, channelGroups, uuids)
Replace with
grantToken(ttl, meta, authorizedUUID, channels, channelGroups, uuids)This function establishes access permissions for PubNub Access Manager (PAM) by setting the read or write attribute to true. A grant with read or write set to false (or not included) will revoke any previous grants with read or write set to true.
Permissions can be applied to any one of three levels:
Application level privileges are based on
subscribeKeyapplying to all associated channels.Channel level privileges are based on a combination of
subscribeKeyandchannelname.User level privileges are based on the combination of
subscribeKey,channel, andauth_key.
Parameters
Set to true to request the read permission. Defaults to false.
Set to true to request the write permission. Defaults to false.
Set to true to request the read permission. Defaults to false.
Set to true to request the delete permission. Defaults to false.
Time in minutes for which granted permissions are valid. Setting ttl to 0 will apply the grant indefinitely, which is also the default behavior.
Specifies authKey to grant permissions to. It's possible to specify multiple auth keys. You can also grant access to a single authKey for multiple channels at the same time.
Specifies the channels on which to grant permissions. If no channels/channelGroups are specified, then the grant applies to all channels/channelGroups that have been or will be created for that publish/subscribe key set.
Furthermore, any existing or future grants on specific channels are ignored,
until the all channels grant is revoked.
It's possible to grant permissions to multiple channels simultaneously.
Wildcard notation like a.* can be used to grant access on channels. You can grant one level deep.
- `a.*` - you can grant on this.
- `a.b.*` - grant won't work on this. If you grant on `a.b.*`,
the grant will treat `a.b.*` as a single channel with name `a.b.*`.Specifies the channel groups to grant permissions to. If no channels or channelGroups are specified, then the grant applies to all channels/channelGroups that have been or will be created for that publish/subscribe key set.
Furthermore, any existing or future grants on specific [channelGroups] are ignored,
until the all [channelGroups] grant is revoked.
It's possible to grant permissions to multiple [channelGroups] simultaneously.Deprecated
This function is deprecated. Use the grantToken(ttl, meta, authorizedUUID, channels, channelGroups, uuids)
Replace with
grantToken(ttl, meta, authorizedUUID, channels, channelGroups, uuids)See grant