Class: Ace

Ace(arg)

An access control entry, which binds together

  • an access control strategy,
  • a principal,
  • a securable, and
  • an action.

You may also provide a sameness tester function to determine sameness amongst objects, defaulting to Ace.testDefaultSameness.

Constructor

new Ace(arg)

Constructor that uses the given strategy to grant or deny the action to or from the principal, respectively, with respect to the securable.

Parameters:
Name Type Description
arg Object

The argument.

Properties
Name Type Attributes Description
strategy AccessControlStrategy

The Ace's strategy.

principal any

The Ace's principal.

securable any

The Ace's securable.

action any

The Ace's action.

samenessTesterFn SamenessTesterFn <optional>

A function used to determine if two objects are equivalent, defaulting to Ace.testDefaultSameness.

Source:

Methods

(static) denying(arg) → {Ace}

A factory method for producing an Ace that statically denies the action to the principal with respect to the securable.

Parameters:
Name Type Description
arg Object

The argument.

Properties
Name Type Attributes Description
strategy AccessControlStrategy

The Ace's strategy.

principal any

The Ace's principal.

securable any

The Ace's securable.

action any

The Ace's action.

samenessTesterFn SamenessTesterFn <optional>

A function used to determine if two objects are equivalent, defaulting to Ace.testDefaultSameness.

Source:
Returns:
Type
Ace

(static) granting(arg) → {Ace}

A factory method for producing an Ace that statically grants the action to the principal with respect to the securable.

Parameters:
Name Type Description
arg Object

The argument.

Properties
Name Type Attributes Description
strategy AccessControlStrategy

The Ace's strategy.

principal any

The Ace's principal.

securable any

The Ace's securable.

action any

The Ace's action.

samenessTesterFn SamenessTesterFn <optional>

A function used to determine if two objects are equivalent, defaulting to Ace.testDefaultSameness.

Deprecated:
  • use Ace.permitting
Source:
Returns:
Type
Ace

(static) of(arg) → {Ace}

A factory method for producing an Ace that uses the given strategy to grant or deny the action to or from the principal, respectively, with respect to the securable.

Parameters:
Name Type Description
arg Object

The argument.

Properties
Name Type Attributes Description
strategy AccessControlStrategy

The Ace's strategy.

principal any

The Ace's principal.

securable any

The Ace's securable.

action any

The Ace's action.

samenessTesterFn SamenessTesterFn <optional>

A function used to determine if two objects are equivalent, defaulting to Ace.testDefaultSameness.

Source:
Returns:
Type
Ace

(static) permitting(arg) → {Ace}

A factory method for producing an Ace that statically permits the principal to take the action with respect to the securable.

Parameters:
Name Type Description
arg Object

The argument.

Properties
Name Type Attributes Description
strategy AccessControlStrategy

The Ace's strategy.

principal any

The Ace's principal.

securable any

The Ace's securable.

action any

The Ace's action.

samenessTesterFn SamenessTesterFn <optional>

A function used to determine if two objects are equivalent, defaulting to Ace.testDefaultSameness.

Since:
  • 1.3.0
Source:
Returns:
Type
Ace

denies(arg)

Returns whether this Ace explicitly denies the given principal the action with respect to the given securable, given optional data.

Parameters:
Name Type Description
arg AccessControlTuple

The argument to be deconstructed.

Properties
Name Type Attributes Description
principal any

The principal in question.

action any

The action in question.

securable any

The securable in question.

data any <optional>

Optional contextual data.

Source:

grants(arg)

Returns whether this Ace grants and does not explicitly deny the given principal the action with respect to the given securable, given optional data.

Parameters:
Name Type Description
arg AccessControlTuple

The argument to be deconstructed.

Properties
Name Type Attributes Description
principal any

The principal in question.

action any

The action in question.

securable any

The securable in question.

data any <optional>

Optional contextual data.

Deprecated:
  • use Ace#permits
Source:

permits(arg)

Returns whether this Ace permits and does not explicitly deny the given principal the action with respect to the given securable, given optional data.

Parameters:
Name Type Description
arg AccessControlTuple

The argument to be deconstructed.

Properties
Name Type Attributes Description
principal any

The principal in question.

action any

The action in question.

securable any

The securable in question.

data any <optional>

Optional contextual data.

Since:
  • 1.3.0
Source: