Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PermissionLevels

Permission levels. See {@tutorial UnderstandingPermissionLevels} for more information how to use this class to define custom permissions.

tutorial

UnderstandingPermissionLevels

Hierarchy

Index

Constructors

constructor

Properties

Readonly size

size: number

Accessors

first

firstKey

  • get firstKey(): number | null
  • The first key of this cache

    Returns number | null

firstValue

last

lastKey

  • get lastKey(): number | null
  • The last key of this cache

    Returns number | null

lastValue

Static [Symbol.species]

  • get [Symbol.species](): typeof Cache

Methods

Protected _set

  • Adds levels to the levels cache to be converted to valid permission structure

    since

    0.2.1

    Parameters

    • level: number

      The permission number for the level you are defining

    • obj: typeof empty | PermissionLevelsLevel

      Whether the level should break (stop processing higher levels, and inhibit a no permission error)

    Returns this

add

clear

  • clear(): void
  • Returns void

clone

concat

debug

  • debug(): string

delete

  • delete(): never

equals

  • Naive equality compare function

    Parameters

    Returns boolean

every

  • Tests if every entry in this cache meets a condition

    Parameters

    Returns boolean

filter

find

findKey

  • findKey(fn: (value: typeof empty | PermissionLevelsLevel, key: number, map: this) => boolean, thisArg?: any): number | undefined
  • Finds a key from this Cache

    Parameters

    Returns number | undefined

findValue

forEach

get

has

  • has(key: number): boolean
  • Parameters

    • key: number

    Returns boolean

isValid

  • isValid(): boolean

map

  • Maps this Cache to an array (like Array#map())

    Type parameters

    • T

    Parameters

    Returns T[]

reduce

  • reduce<I>(fn: (accumulator: I, value: typeof empty | PermissionLevelsLevel, key: number, map: this) => I, initialValue: I, thisArg?: any): I
  • Reduces this cache into a singularity

    Type parameters

    • I

    Parameters

    • fn: (accumulator: I, value: typeof empty | PermissionLevelsLevel, key: number, map: this) => I

      The function to determine how this Cache is reduced

    • initialValue: I

      The initial value

    • Optional thisArg: any

      Optional binding for the fn param

    Returns I

remove

  • remove(level: number): this

run

set

  • set(): never

some

  • Tests if some entries in this cache meets a condition

    Parameters

    Returns boolean

sort

  • Sorts entries in-place in this Cache

    Parameters

    Returns this

sorted

sweep

  • Sweeps entries from this Cache

    Parameters

    Returns number

Protected validate

  • validate(): this

Generated using TypeDoc