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

    Public access is expressed explicitly by the wildcard allow rule ({'*': 'allow'}). For backwards compatibility an empty rule set (no allow rules at all) is still treated as public, matching object/file instance ACLs and pre-migration server payloads. A wildcard deny rule ({'*': 'deny'}) or any specific allow rule means access is not public.

    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

  • Revokes public access by removing the wildcard allow rule.

    This is the inverse of setPublicAllowed. Only the public wildcard allow rule ({'*': 'allow'}) is removed; a wildcard deny rule ({'*': 'deny'}) and all user/role specific rules are left untouched. If no allow rules remain afterwards the permission serializes as omitted, so the server applies its default unless access is granted to specific users/roles.

    Returns

    Returns void

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

    Public access is represented explicitly as a wildcard allow rule ({'*': 'allow'}) so it can be distinguished from an unconfigured permission (empty rules) over the wire. Any other allow rules become redundant and are removed; existing deny rules are kept.

    Returns

    Returns void

  • A Json representation of the set of rules

    Returns

    A Json representation of the rules, or undefined when no rules are set so the key can be omitted from serialized schema JSON and server-side defaults take effect

    Returns undefined | JsonMap

  • Creates a permission from the given rules.

    Returns

    The permission.

    Parameters

    Returns Permission

Generated using TypeDoc