All pages
Powered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

Roles and Permission

social.plus uses roles and permissions to provide users the ability to fully customize the moderation experience on the platform. To learn more about social.plus SDKs default roles and permissions, refer to the Roles & Permissions page.

Roles

The creator of the channel can add and remove the role of a user via AmityChannelModeration.

Version 6

Beta (v0.0.1)

  1. The channel creator is automatically assigned as the channel moderator.

  2. The previous/last moderator is not allowed to leave a community and an error is displayed.

  3. The channel moderator can promote a user/member to a moderator.

Permission

You can check your permission in the channel by sending AmityPermission enums to AmityCoreClient.hasPermission(amityPermission).

  • The channel moderator can demote a moderator to a user/member.

  • This applies only to Live and Community channels’. This does not apply to the Conversation Channel.

    Moderation

    Moderation is an important feature for building a safe community that encourages user participation and engagement.

    social.plus’s customer-centric nature ensures that security needs are kept at the forefront of the work we do. Our purpose has been to continuously develop features that are safe and ready to use. We power our moderators with tools to control and impose permissions that make their applications a safer place, for all users. We put the utmost importance on giving power to our clients to implement protocols that keep their applications healthy, safe, and compliant.

    1. The channel creator is automatically assigned as the channel moderator.

    2. The previous/last moderator is not allowed to leave a community and an error is displayed.

    3. The channel moderator can promote a user/member to a moderator.

    4. The channel moderator can demote a moderator to a user/member.

    This applies only to Live and Community channels’. This does not apply to the Conversation Channel.

    ChannelModeration class provides various methods to moderate the users present in the channel. You can ban/unban users, assign roles, or remove them from a user.

    Channel Rate-Limiting

    This method is useful when there is a large number of messages going through the channel, which can make the message stream hard to follow. Setting a rate limit enables the SDK to queue up messages once the number of messages in a specified window exceeds the defined limit, allowing a slower stream of messages to be published to the user at the expense of adding more latency (because newer messages will be sent to the queue first and not delivered until all previously queued messages are delivered).

    There is an internal limit of 1000 messages that can be queued by the rate limit service, if more than 1000 messages are queued up, the system may skip publishing the older messages in order to make room for newer messages. We believe this is the preferred behavior for users, as users will most likely want to see newer messages in a real-time conversation instead of waiting for a significant amount of time for old messages to be published to them first.

    Note that the SDK permanently stores all messages it receives in the system before the rate limit comes into effect: in the case of a large spike of incoming messages, even if a message did not get published to a user in real-time, that user can still scroll up to see message history and see that past message.

    repository.rateLimitPeriod(600, rateLimit: 5, rateLimitWindow: 60) { success, error in
      ...
    }

    The functionality isn't currently supported by this SDK.

    Supported ✅ (please wait while we prepare a real example!)

    The functionality isn't currently supported by this SDK.

    The above method enables a rate limit of 5 messages every 60 seconds: once there are more than 5 messages sent, from any user, within 60 seconds, those messages will be queued on the server and not published to other channel members until 60 seconds have passed. The rate limit will last as long as the period specified in the method call: in the example above the rate limit will be active for 10 minutes (600 seconds).

    If you would like to have a permanent rate limit, call the method above with a period of -1 seconds.

    To disable the rate limit, simply call removeRateLimitWithCompletion:

    The functionality isn't currently supported by this SDK.

    Supported ✅ (please wait while we prepare a real example!)

    The functionality isn't currently supported by this SDK.

    repository.setRateLimit({
      period: 600,
      rateLimit: 5,
      rateLimitWindow: 60,
    }).catch(error => {
      ...
    });JavaScript
    repository.removeRateLimit { success, error in
      ...
    }
    repository.removeRateLimit().catch(error => {
      ...
    });

    Mute/Unmute a List of Channel Members

    Moderators can mute and unmute users. When a user is muted, they cannot send messages in a channel. However, muted users will still be allowed to observe messages in a channel. The status of being muted is indefinite but is only applied at the channel level. The mute and unmute operations can be done viaChannel object.

    Muting Channel Members

    When a user is muted, they cannot send messages in a channel and all the messages sent by that user to that channel will be rejected. This method is useful for preventing certain members from sending inappropriate messages, but still allowing them to participate in the conversation in a read-only manner. The timeout property allows you to make the timeout temporary, or permanent until unset by passing in -1.

    Unmuting Channel Members

    This feature is not applicable in Broadcast and Conversation channel. Calling muteMembers() or unmuteMembers() on these channels will result in an error.

    repository.muteMembers({
      userIds: ['user1'],
      period: 600,
    }).catch(error => {
      ...
    });
    repository.unmuteMembers({
      userIds: ['user1'],
    }).catch(error => {
      ...
    });

    Ban/Unban a List of Channel Members

    When a user is banned in a channel, they are removed from a channel and no longer able to participate or observe messages in that channel.

    Moderators can ban and unban users. When a user is banned from a channel, they are forcibly removed from the channel and may no longer participate or observe messages in that channel. All their previous messages in the channel will also be automatically deleted.

    A user that has been banned from a channel can not rejoin the channel until they have been unbanned.

    Global Ban

    As well as the banning and unbanning of users, admins also have the ability to global ban a user. When a user is globally banned, they can no longer access social.plus's network and will be forcibly removed from all their existing channels. All the globally banned user's messages will also be deleted.

    The globally banned user can not access Amity's network again until they have been globally unbanned.

    When a user is banned, it can take up to 30 seconds before the user is disconnected from the network.

    Ban Users

    Banning members is a more heavy-handed moderation method. When a user is banned, all its messages are retroactively deleted, it will be removed from the channel, and it will not be allowed to join the channel again until it is explicitly unbanned.

    Version 6

    Beta (v0.0.1)

    Unban Users

    Supported ✅ (please wait while we prepare a real example!)

    Version 6

    Beta (v0.0.1)

    This feature does not work with Broadcast and Conversation channels. Calling banMembers() or unbanMembers() on these channels will result in an error.

    
    let moderation = AmityChannelModeration(client: <amityclient>, channel: <channel-id>)
    ​
    moderation.banMembers(["user1"]) { success, errror in
      ...
    }
    repository.banMembers({
      userIds: ['user1'],
    }).catch(error => {
      ...
    });
    repository.unbanMembers({
      userIds: ['user1'],
    }).catch(error => {
      ...
    });