Skip to main content

analyzeCondition

@webda/iam


Function: analyzeCondition()

analyzeCondition(condition): object

Defined in: packages/iam/src/conditions.ts:133

Validate a condition against the allow-list

The condition is validated twice: as written, and in the form node-casbin evaluates (escapeAssertion rewrites r. to r_ only after certain characters, and also inside string literals, then replaceEval wraps the result in parentheses). The two must agree.

Parameters​

condition​

string

the Casbin expression

Returns​

object

whether the condition reads the operation input (r.ctx.input)

readsInput​

readsInput: boolean

Throws​

PolicyCompileError when the condition is invalid or not allowed