Source code for py_abac.policy.conditions.numeric.gt

"""
    Numeric greater than conditions
"""

from marshmallow import post_load

from .base import NumericCondition, NumericConditionSchema


[docs]class Gt(NumericCondition): """ Condition for number `what` greater than `value` """ def _is_satisfied(self, what) -> bool: return what > self.value
[docs]class GtSchema(NumericConditionSchema): """ JSON schema for greater than numeric condition """
[docs] @post_load def post_load(self, data, **_): # pylint: disable=missing-docstring,no-self-use return Gt(**data)