PolicyConfigLifecycleFunction<Defined in: policyCore/policyConfig/types.ts:17AbilityParams
,UserParams
,AllowResult
,DenyResult
> = (args
,ctx
) =>Promise
<EnforcePolicyResponse
<AllowResult
extendsz.ZodUndefined
?ContextAllowResponseNoResult
:ContextAllowResponse
<z.infer
<AllowResult
>> |DenyResult
extendsz.ZodUndefined
?ContextDenyResponseNoResult
:ContextDenyResponse
<z.infer
<DenyResult
>>>>
evaluate()
and precheck()
functions that you define when using createVincentPolicy()
will match this function signature.
Note that the arguments and return types are inferred based on the ZOD schemas that you pass to createVincentPolicy
Type Parameters
AbilityParams
AbilityParams
extends z.ZodType
UserParams
UserParams
extends z.ZodType
= z.ZodUndefined
AllowResult
AllowResult
extends z.ZodType
= z.ZodUndefined
DenyResult
DenyResult
extends z.ZodType
= z.ZodUndefined
Parameters
args
abilityParams
z.infer
<AbilityParams
>
userParams
z.infer
<UserParams
>
ctx
PolicyContext
<AllowResult
, DenyResult
>
Returns
Promise
<EnforcePolicyResponse
<AllowResult
extends z.ZodUndefined
? ContextAllowResponseNoResult
: ContextAllowResponse
<z.infer
<AllowResult
>> | DenyResult
extends z.ZodUndefined
? ContextDenyResponseNoResult
: ContextDenyResponse
<z.infer
<DenyResult
>>>>