View Source Permit.Permissions.ParsedCondition (permit v0.2.1)

Represents the product of parsing a condition by a function implementing the Permit.Permissions.can/1 callback.

A condition parsed by Permit's rule syntax parser contains:

  • condition semantics, that is: a function that allows for checking whether the condition is satisfied
  • an indication of whether it is negated (i.e. a condition defined as {:not, ...})
  • metadata (:private), which can be used by alternative parsers (e.g. Permit.Ecto.Permissions puts dynamic query constructors there)

Part of the private API, subject to changes and not to be used on the application level.

Summary

Types

@type condition_type() :: :const | :function_1 | :function_2 | {:operator, module()}