A event broken down into its core components for easy processing Event Structure: module/path/name:property:method Example: users/system:crud or storage/some/path/file.txt:r

Constructors

Properties

fullPath: string

Entire path, including the module & name

methods: ASet<Method>

List of methods

module: string

First directory in path

name: string

Last sagment of path

path: string

Path including the name, excluding the module

Accessors

  • get all(): boolean
  • All/Wildcard specified

    Returns boolean

  • set all(v): void
  • Parameters

    • v: boolean

    Returns void

  • get create(): boolean
  • Create method specified

    Returns boolean

  • set create(v): void
  • Parameters

    • v: boolean

    Returns void

  • get delete(): boolean
  • Delete method specified

    Returns boolean

  • set delete(v): void
  • Parameters

    • v: boolean

    Returns void

  • get none(): boolean
  • None specified

    Returns boolean

  • set none(v): void
  • Parameters

    • v: boolean

    Returns void

  • get read(): boolean
  • Read method specified

    Returns boolean

  • set read(v): void
  • Parameters

    • v: boolean

    Returns void

  • get update(): boolean
  • Update method specified

    Returns boolean

  • set update(v): void
  • Parameters

    • v: boolean

    Returns void

Methods

  • Filter a set of paths based on this event

    Parameters

    Returns PathEvent[]

    Whether there is any overlap

  • Create event string from its components

    Returns string

    String representation of Event

  • Combine multiple events into one parsed object. Longest path takes precedent, but all subsequent methods are combined until a "none" is reached

    Parameters

    • Rest...paths: (string | PathEvent)[]

      Events as strings or pre-parsed

    Returns PathEvent

    Final combined permission

  • Filter a set of paths based on the target

    Parameters

    • target: string | PathEvent | (string | PathEvent)[]

      Array of events that will filtered

    • Rest...filter: (string | PathEvent)[]

      {...PathEvent} Must container one of

    Returns PathEvent[]

    Whether there is any overlap

  • Squash 2 sets of paths & return true if any overlap is found

    Parameters

    • target: string | PathEvent | (string | PathEvent)[]

      Array of Events as strings or pre-parsed

    • Rest...has: (string | PathEvent)[]

      Target must have at least one of these path

    Returns boolean

    Whether there is any overlap

  • Squash 2 sets of paths & return true if the target has all paths

    Parameters

    • target: string | PathEvent | (string | PathEvent)[]

      Array of Events as strings or pre-parsed

    • Rest...has: (string | PathEvent)[]

      Target must have all these paths

    Returns boolean

    Whether there is any overlap

  • Same as hasAll but raises an error if the target is missing any paths

    Parameters

    • target: string | PathEvent | (string | PathEvent)[]

      Array of Events as strings or pre-parsed

    • Rest...has: (string | PathEvent)[]

      Target must have all these paths

    Returns void

  • Same as has but raises an error if there is no overlap

    Parameters

    • target: string | PathEvent | (string | PathEvent)[]

      Array of Events as strings or pre-parsed

    • Rest...has: (string | PathEvent)[]

      Target must have at least one of these path

    Returns void

  • Create event string from its components

    Parameters

    • path: string | string[]

      Event path

    • methods: Method | Method[]

      Event method

    Returns string

    String representation of Event