State API

flask_acl.state.parse_state(state)[source]

Convert a bool, or string, into a bool.

The string pairs we respond to (case insensitively) are:

  • ALLOW & DENY
  • GRANT & REJECT
Returns bool:True or False.
Raises ValueError:
 when not a bool or one of the above strings.

E.g.:

>>> parse_state('Allow')
True

Related Topics

This Page