Class representing a Permission

Constructors

  • Parameters

    • data:
          | {
              channelId: string;
              createdAt: string;
              permissions: {
                  [key: string]: boolean;
              };
              roleId: number;
              updatedAt?: string;
          }
          | {
              channelId: string;
              createdAt: string;
              permissions: {
                  [key: string]: boolean;
              };
              updatedAt?: string;
              userId: string;
          }
          | {
              categoryId: number;
              createdAt: string;
              permissions: {
                  [key: string]: boolean;
              };
              updatedAt?: string;
              userId: string;
          }
          | {
              categoryId: number;
              createdAt: string;
              permissions: {
                  [key: string]: boolean;
              };
              roleId: number;
              updatedAt?: string;
          }

    Returns Permission

Properties

createdAt: Date

Date of the creation of the permission

data:
    | {
        channelId: string;
        createdAt: string;
        permissions: {
            [key: string]: boolean;
        };
        roleId: number;
        updatedAt?: string;
    }
    | {
        channelId: string;
        createdAt: string;
        permissions: {
            [key: string]: boolean;
        };
        updatedAt?: string;
        userId: string;
    }
    | {
        categoryId: number;
        createdAt: string;
        permissions: {
            [key: string]: boolean;
        };
        updatedAt?: string;
        userId: string;
    }
    | {
        categoryId: number;
        createdAt: string;
        permissions: {
            [key: string]: boolean;
        };
        roleId: number;
        updatedAt?: string;
    }

raw data

Type declaration

  • channelId: string

    Channel ID Format: uuid

    The ID of the channel

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the permission override was created at

  • permissions: {
        [key: string]: boolean;
    }
    • [key: string]: boolean
  • roleId: number

    Role ID

    The ID of the role

  • OptionalupdatedAt?: string

    Updated at Format: date-time

    The ISO 8601 timestamp that the permission override was updated at, if relevant

Type declaration

  • channelId: string

    Channel ID Format: uuid

    The ID of the channel

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the permission override was created at

  • permissions: {
        [key: string]: boolean;
    }
    • [key: string]: boolean
  • OptionalupdatedAt?: string

    Updated at Format: date-time

    The ISO 8601 timestamp that the permission override was updated at, if relevant

  • userId: string

    User ID Format: user-id

    The ID of the user

Type declaration

  • categoryId: number

    The ID of the category

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the permission override was created at

  • permissions: {
        [key: string]: boolean;
    }
    • [key: string]: boolean
  • OptionalupdatedAt?: string

    Updated at Format: date-time

    The ISO 8601 timestamp that the permission override was updated at, if relevant

  • userId: string

    User ID Format: user-id

    The ID of the user

Type declaration

  • categoryId: number

    The ID of the category

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the permission override was created at

  • permissions: {
        [key: string]: boolean;
    }
    • [key: string]: boolean
  • roleId: number

    Role ID

    The ID of the role

  • OptionalupdatedAt?: string

    Updated at Format: date-time

    The ISO 8601 timestamp that the permission override was updated at, if relevant

parentID: null | string | number

Parent object, where the permission is applied.

target: string

Permission target

targetID: null | string | number

Permission target ID

updatedAt: null | Date

Date of the last edition of the permission

Methods