Skip to content

Type Alias: ScopedGuard<T, G, K, O, A> ​

ts
type ScopedGuard<T, G, K, O, A> = <X>(args, ...rest) => Promise<SubjectRbac<T, ScopedGuardName<T, RequirementGuard<X, G>>>>;

Defined in: packages/react-router/src/server.ts:119

A guard when the engine has per-guard names: the names (and the subject) follow the guard the call checks in.

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfig-
G extends string-
K extends GuardKind-
O-
A extends RouteArgsRouteArgs

Type Parameters ​

Type Parameter
X extends readonly (GuardNames | O)[]

Parameters ​

ParameterType
argsA
...restX & GuardRequirementArgs<X, T, K, G, O>

Returns ​

Promise<SubjectRbac<T, ScopedGuardName<T, RequirementGuard<X, G>>>>

Released under the MIT License. Inspired by spatie/laravel-permission.