Operations to permissions mapping

The tables below list each PubNub API operation, the resource it targets, and the permission flag it requires when Access Manager is enabled on a keyset.

Chat SDK

For Chat SDK method to Access Manager permission mappings, see Security and permissions.

Pub/Sub​

Pub/Sub sends and receives messages on channels. These operations need permissions on the channel or channel group they target.

OperationResourcePermission
Publish on channelChannelwrite
Signal on channelChannelwrite
Subscribe to channelChannelread
Subscribe to presence channelPresence channel (-pnpres)read
Subscribe to channel groupChannel groupread
Subscribe to presence channel groupPresence channel group (-pnpres)read
Unsubscribe from channelChannelNone required
Unsubscribe from channel groupChannel groupNone required

Presence​

Presence tracks which users are connected to a channel and their state. These operations need permissions on the channel.

OperationResourcePermission
Here NowChannelread
Where NowChannelNone required
Get StateChannelread
Set StateChannelread

Message Persistence​

Message Persistence stores published messages so clients can fetch them later. These operations need permissions on the channel that holds the messages.

OperationResourcePermission
Fetch messagesChannelread
Message countsChannelread
Delete messagesChanneldelete

File sharing​

Files lets clients send and download files on a channel. These operations need permissions on that channel.

OperationResourcePermission
Send file on channelChannelwrite
List filesChannelread
Download fileChannelread
Delete fileChanneldelete

Channel groups​

A channel group lets a client subscribe to many channels as one unit. These operations need permissions on the channel group.

OperationResourcePermission
Add channels to channel groupChannel groupmanage
Remove channels from channel groupChannel groupmanage
List channels in channel groupChannel groupread
Remove channel groupChannel groupmanage

App Context​

App Context stores user metadata, channel metadata, and memberships. These operations need permissions on the UUID, the channel, or both.

OperationResourcePermission
Set user metadataUUIDupdate
Delete user metadataUUIDdelete
Get user metadataUUIDget
Get all user metadataUUIDManaged by the Disallow Get All User Metadata option in App Context configuration on the Admin Portal. When this option is unchecked and Access Manager is enabled, you can get metadata of all users without a permission grant.
Set channel metadataChannelupdate
Delete channel metadataChanneldelete
Get channel metadataChannelget
Get all channel metadataChannelManaged by the Disallow Get All Channel Metadata option in App Context configuration on the Admin Portal. When this option is unchecked and Access Manager is enabled, you can get metadata of all channels without a permission grant.
Set channel membersChannelmanage
Remove channel membersChannelmanage
Get channel membersChannelget
Set channel membershipsChannel and UUIDChannel: join. UUID: update.
Remove channel membershipsChannel and UUIDChannel: join. UUID: update.
Get channel membershipsUUIDget

Mobile Push Notifications​

Mobile Push Notifications delivers channel messages to devices through Firebase Cloud Messaging (FCM) and Apple Push Notification service (APNs). Only registering a channel needs a channel permission.

OperationResourcePermission
Register channel for pushChannelread on each added channel
Remove channel push registrationNoneNone
List channels for a device (FCM and APNs2)NoneNone
List devices for a channelNoneServer only. Sign the request with the secret key.

Removing a registration and listing a device's channels still check the token if the request includes one. A token that is expired, revoked, or issued for a different User ID returns 403.

Message Actions​

Message Actions attach reactions, receipts, and other metadata to a published message. These operations need permissions on the channel that holds the message.

OperationResourcePermission
Add message actionChannelwrite
Remove message actionChanneldelete
Get message actionsChannelread
Get history with actionsChannelread

Was this page useful?

Last updated on