Class PolicyManager

The Policies class is responsible for managing access control policies and to make sure which user requested actions are allowed and which are not.

Hierarchy

  • PolicyManager

Constructors

Properties

_baseDirectory: string
_loadPromise?: Promise<void>
_policies?: Policy[]
_schemaManager: SchemaManager
_validator: Validator

Methods

  • This function is used to check whether a user action is allowed against a defined Policy

    TODO: Find if this function is used, it seems to be redundant as it may be easily replaced with just Policy calls.

    TODO: Add type definition for userContext.

    Returns

    Parameters

    • policy: Policy

      The Policy object that the action is to be checked against

    • userContext: any

      The corresponding users context

    • action: string

      The action which is to be checked

    Returns boolean

  • The function is used to get a policy by name

    Returns

    Policy object or undefined if it's not found.

    Parameters

    • name: string

    Returns undefined | Policy

  • This method is used to load all the policies from the policy directory.

    Returns Promise<void>

Generated using TypeDoc