PolicyEngine
Class: PolicyEngine
Defined in: packages/iam/src/engine.ts:51
An immutable snapshot of the compiled policies
Properties
enforcer
protectedenforcer:Enforcer
Defined in: packages/iam/src/engine.ts:55
the Casbin enforcer
Methods
decide()
decide(
principals,operationId,ctx):Promise<string|true>
Defined in: packages/iam/src/engine.ts:106
Decide whether principals may call an operation
Parameters
principals
string[]
the caller principals
operationId
string
the operation id
ctx
the request context
Returns
Promise<string | true>
true when allowed, otherwise the refusal reason; an evaluation error is a refusal
build()
staticbuild(policies,attachments):Promise<PolicyEngine>
Defined in: packages/iam/src/engine.ts:63
Build an engine from compiled rows
Parameters
policies
the p rows
attachments
the g rows
Returns
Promise<PolicyEngine>
the engine