Options
Menu

Class ChatPermissionManager

Allows getting and setting permissions for the various capabilities of Chats. The specific permissions are defined in ChatPermission. Permissions can be assigned per-DomainUser, per-UserGroup, or for everybody (setWorldPermissions).

Generally speaking, more specific permissions override less-specific ones. So a user's explicit permission would override the group's permission which the user is in, which would itself override any world permission for this Chat.

Hierarchy

Index

Methods

addGroupPermissions

addUserPermissions

addWorldPermissions

getAllGroupPermissions

getAllUserPermissions

getGroupPermissions

getPermissions

getUserPermissions

getWorldPermissions

id

  • id(): string
  • Returns string

    The id of the chat this permissions manager manages permissions for.

removeGroupPermissions

removeUserPermissions

removeWorldPermissions

resolveSessionPermissions

setGroupPermissions

  • Sets the given permissions for the given groups.

    Parameters

    • permissions: StringMapLike<Set<ChatPermission> | ChatPermission[]>

      an object which maps one or more group IDs to their new set of permissions

    • replaceAll: boolean = false

      Determines if the map passed in represents the entire set of group permissions to set. All permissions for other groups will be removed. The default is false.

    Returns Promise<void>

    A resolved promise if successful

setUserPermissions

  • Sets the given permissions for the given users

    Parameters

    • permissions: DomainUserMapping<Set<ChatPermission> | ChatPermission[]>

      an object which maps one or more usernames to their new set of permissions

    • replaceAll: boolean = false

      Determines if the map passed in represents the entire set of user permissions to set. All permissions for other user will be removed. The default is false.

    Returns Promise<void>

    A resolved promise if successful

setWorldPermissions