Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Permissions

A Permissions object is responsible for requesting and storing access permissions information associated with an Aeris API account.

Hierarchy

Index

Constructors

constructor

  • new Permissions(id: string, secret: string): Permissions
  • Initializes a permissions object for an account associated with the specified client id and secret.

    Parameters

    • id: string
    • secret: string

    Returns Permissions

Properties

id

id: string

The account client id.

secret

secret: string

The account client secret.

Methods

canAccess

  • canAccess(endpoint: string): boolean
  • Returns whether the account has access to the specified endpoint or destination.

    Parameters

    • endpoint: string

    Returns boolean

get

  • Returns a Promise containing the permissions data, fetching the data from the API initially if required.

    Returns Promise<AccountPermissions>

has

  • has(type: string): boolean
  • Returns whether the listeners are registered for the specified event name.

    memberof

    EventDispatcher

    Parameters

    • type: string

    Returns boolean

hasLoaded

  • hasLoaded(): boolean
  • A Boolean value indicating if permissions have been loaded.

    Returns boolean

isLoading

  • isLoading(): boolean
  • A Boolean value indicating if permissions data is currently being requested from the API.

    Returns boolean

off

  • Removes a registered listener function for the specified event.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to remove the listener for.

    • callback: Function

      Handler function to remove so it won't be executed next time the event is triggered.

    • Default value scope: any = null

    Returns EventDispatcher

offAll

on

  • on(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed each time an event occurs

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

once

  • once(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed the first time an event occurs.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

trigger

  • Triggers the specified event so that all registered listeners will be executed with the specified parameters.

    memberof

    EventDispatcher

    Parameters

    • type: any

      Event name to trigger

    • Default value data: any = null

    Returns EventDispatcher

Generated using TypeDoc