PubNub Logo Docs
Support Contact Sales Login Try Our APIs

›MODERATION

Collapse all
Dark mode

Back to Home

Overview

  • In-App Chat

Chat Components

  • Overview
  • REACT

    • React Components

    ANDROID

    • Getting Started
    • UI Components
    • Data Components
    • Chat Provider

    IOS

    • Getting Started
    • UI Components
    • Data Components
    • Chat Provider

SDKs

  • Overview
  • USERS

    • Setup
    • Metadata
    • Permissions
    • Presence
    • Mentions

    CHANNELS

    • Types and Names
    • Metadata
    • Subscriptions
    • Memberships

    MESSAGES

    • Sending Messages
    • Message Storage
    • Unread Counts
    • File Upload
    • Typing Indicators
    • Read Receipts
    • Emoji Reactions
    • Update Messages
    • Delete Messages
    • Message Webhooks

    PUSH NOTIFICATIONS

    • Overview

    MODERATION

    • Profanity Filters
    • Flag Messages
    • Ban Users
    • Mute Users
    • Spam Prevention

    INTEGRATIONS

    • Overview
    • Content Moderation
    • Image Moderation
    • Language Translation
    • Chatbots
    • GIFs
    • Stickers

Moderation Dashboard

  • Overview
  • Getting Started
  • FEATURES

    • Automatic Text Moderation
    • Automatic Image Moderation
    • Manual Message Moderation
    • Manual User Moderation
    • User Management
    • Channel Management
  • Required Configuration

Debug Console
Network Status

Muting users

Access Manager enables you to manage access for individual users so they can be muted on specific channels.

Mute user in channels

To mute user-1 in specific channels, call the grant token method and request only read permissions on these channels.

Node.js
Python
Java
Kotlin

Go to SDK

pubnub.grantToken(
{
ttl: 15,
authorized_uuid: "user-1",
resources: {
channels: {
"channel-a": {
read: true
},
"channel-b": {
read: true
}
}
}
}, function(status, token) {
console.log(token);
}
);

Go to SDK

channels = [
Channel.id("channel-a").read(),
Channel.id("channel-b").read()
]
envelope = pubnub.grant_token()
.channels(channels)
.ttl(15)
.authorized_uuid("user-1")
.sync()

Go to SDK

pubnub.grantToken()
.ttl(15)
.authorizedUUID("user-1")
.channels(Arrays.asList(
ChannelGrant.name("channel-a").read()
ChannelGrant.name("channel-b").read()))
.async(new PNCallback<PNGrantTokenResult>() {
@Override
public void onResponse(@Nullable PNGrantTokenResult result, @NotNull PNStatus status) {
if (status.error()) {
// Handle error
}
else {
// Handle result
}
}
});

Go to SDK

pubnub.grantToken(
ttl = 15,
authorizedUUID = "user-1",
channels = listOf(
ChannelGrant.name(name = "channel-a", read = true, write = false),
ChannelGrant.name(name = "channel-b", read = true, write = false)
)
)
.async { result, status ->
if (status.error) {
// Handle error
} else {
// Handle result
}
}
←Ban UsersSpam Prevention→
  • Mute user in channels
© PubNub Inc. - Privacy Policy