Skip to main content
Use hasPermission to decide whether the current user should see or perform protected actions such as deleting messages, editing community posts, or banning users. Permission checks are scope-aware: some checks are global, while others are evaluated for a channel or community.
Permissions are assigned through roles and membership state. The SDK checks the permissions already available for the current user and returns a Boolean-style result.

Parameters

Check a permission

Use the scope that matches the action you are gating. For example, message deletion inside a channel should use a channel-scoped permission check, while community post editing should use a community-scoped check.

Inputs

Platform notes

  • TypeScript permission checks are synchronous Boolean checks against current cached user, channel membership, or community membership data.
  • iOS permission checks are async and return Bool.
  • Android permission checks return Flowable<Boolean>.
  • Flutter permission checks return bool.
  • Use the permission constant that matches the action and scope. Permission names differ by platform enum casing, but they map to server permission strings such as DELETE_MESSAGE, EDIT_COMMUNITY_POST, and BAN_USER.

User Identity

Understand the stable userId used by permission checks.

Flag and Unflag Users

Add user reporting actions for moderation workflows.