A list of guards or guard classes.
When called in a usingGuard
method, they might be joined by a or
condition.
An observable, promise, or sync value.
Any type of policy that can be handled. It can either be
Booleans are handled in a special ways:
true
, the policy guards are never ran. This could be used to expose a single anonymously accessible endpoint on a masked controller.false
, only the {@link PoliciesGuard} is ran, and throws a ForbiddenException: Endpoint statically forbidden
.In all other cases, all guards are ran.
A dictionary of policies to apply on a class. All properties must be methods of the class it is applied on, except *
.
The *
key is a fallback policy used when no more specific key matches. We strongly recommend to use it with false
, to explicitly allow endpoints.
A simple policy defined by an action
and a subject
.
A parameter decorator factory that retrieve the ability of the current request.
Set to false
to not throw if no ability was found for the request. Defaults to true
.
a parameter decorator that will set the parameter value to the ability. If not {@link required} and none is found, a new empty ability will be created.
A class decorator factory that you can call by passing a PolicyDescriptorMask. You can also call PoliciesMask.usingGuard to create a new PoliciesMask decorator that will always apply the given guards before checking.
A mask of policy descriptors.
a class decorator.
A method & class decorator factory that you can call by passing a PolicyDescriptor. You can also call Policy.usingGuard to create a new Policy decorator that will always apply the given guards before checking.
The policy descriptor.
a method or class decorator.
Prepare a new couple of Policy
& PoliciesMask
decorators bound to use the given {@link guards}.
A list of guards to use.
an function with properties containing the new decorators. You may call again this function to add more guards.
Generated using TypeDoc
A couple of
Policy
&PoliciesMask
decorators using predefined guards. You may call again this object to append more guards.