Options
All
  • Public
  • Public/Protected
  • All
Menu

Permission handling

Hierarchy

  • Permissions

Index

Constructors

Properties

client: CosmosClient

Methods

  • channelBitfieldToPermissionStrings(bitfield: number): string[]
  • getChannelBitfield(channel: Channel, user: User): number
  • Get the channel's permission bitfield

    Parameters

    • channel: Channel

      the channel object

    • user: User

      the user object

    Returns number

    the permission bitfield

  • getChannelPermissions(channel: Channel, user: User): string[]
  • Get the channel permissions in permission strings

    Parameters

    • channel: Channel

      the channel object

    • user: User

      the user object

    Returns string[]

    array of permission strings

  • getServerBitfield(server: Server, user: User): number
  • Get the server's permission bitfield

    Parameters

    • server: Server

      the server object

    • user: User

      the user object

    Returns number

    the permission bitfield

  • getServerPermissions(server: Server, user: User): string[]
  • Get the server permissions in permission strings

    Parameters

    • server: Server

      the server object

    • user: User

      the user object

    Returns string[]

    array of permission strings

  • hasChannelPermissions(channel: Channel, user: User, permissions: ("View" | "SendMessage" | "ManageMessages" | "ManageChannel" | "VoiceCall" | "EmbedLinks" | "UploadFiles" | "Masquerade" | "InviteOthers")[]): boolean
  • Check if the user has the permissions provided

    Parameters

    • channel: Channel

      the channel object

    • user: User

      the user object

    • permissions: ("View" | "SendMessage" | "ManageMessages" | "ManageChannel" | "VoiceCall" | "EmbedLinks" | "UploadFiles" | "Masquerade" | "InviteOthers")[]

      array of permission strings, eg ["View", "SendMessage"]

    Returns boolean

    boolean

  • hasServerPermissions(server: Server, user: User, permissions: ("View" | "ManageRoles" | "ManageChannels" | "ManageServer" | "KickMembers" | "BanMembers" | "ChangeNickname" | "ChangeAvatar" | "RemoveAvatars" | "ManageNicknames")[]): boolean
  • Check if the user has the permissions provided

    Parameters

    • server: Server

      the server object

    • user: User

      the user object

    • permissions: ("View" | "ManageRoles" | "ManageChannels" | "ManageServer" | "KickMembers" | "BanMembers" | "ChangeNickname" | "ChangeAvatar" | "RemoveAvatars" | "ManageNicknames")[]

      array of permission strings, eg ["View", "ChangeNickname"]

    Returns boolean

    boolean

  • serverBitfieldToPermissionStrings(bitfield: number): string[]

Generated using TypeDoc