Class Permission

An aggregation of access rules for given object metadata.

Hierarchy

  • Permission

Constructors

Properties

rules: {
    [ref: string]: string;
} = {}

Type declaration

  • [ref: string]: string
BASE_PERMISSIONS: BasePermission = ...

Methods

  • Returns a list of user and role references of all rules

    Returns

    a list of references

    Returns string[]

  • Allows the given users or rules to perform the operation

    Returns

    this permission object

    Parameters

    • Rest ...userOrRole: TrustedEntity[]

      The users or roles to allow

    Returns Permission

  • Removes all rules from this permission object

    Returns

    Returns void

  • Copies permissions from another permission object

    Returns

    Parameters

    • permission: Permission

      The permission to copy from

    Returns Permission

  • Deletes any allow/deny rules for the given users or roles

    Returns

    this permission object

    Parameters

    • Rest ...userOrRole: TrustedEntity[]

      The users or roles to delete rules for

    Returns Permission

  • Denies the given users or rules to perform the operation

    Returns

    this permission object

    Parameters

    Returns Permission

  • Sets the permission rules from json

    Returns

    Parameters

    • json: JsonMap

      The permission json representation

    Returns void

  • Returns the actual rule of the given user or role.

    Returns

    The actual access rule or undefined if no rule was found

    Parameters

    Returns string

  • Checks whenever the user or role is explicit allowed to perform the operation.

    Returns

    true If the given user or role is allowed

    Parameters

    Returns boolean

  • Checks whenever the user or role is explicit denied to perform the operation.

    Returns

    true If the given user or role is denied

    Parameters

    Returns boolean

  • Gets whenever all users and roles have the permission to perform the operation

    Returns

    true If public access is allowed

    Returns boolean

  • Resolves user and role references and validate given references

    Returns

    The resolved and validated reference

    Parameters

    Returns string

  • Sets whenever all users and roles should have the permission to perform the operation

    Note: All other allow rules will be removed.

    Returns

    Returns void

  • A Json representation of the set of rules

    Returns

    Returns JsonMap

  • Creates a permission from the given rules.

    Returns

    The permission.

    Parameters

    Returns Permission

Generated using TypeDoc