From fb51982f80572c73fc8dcaf2818a0ad31663a11e Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Tue, 5 Oct 2021 11:09:31 +0200 Subject: Add scope_types attribute to the BaseCheck class Neutron, based on the defined policy rules is creating check objects "in flight" to e.g. include check some object's attributes, like e.g. network's provider parameters. That use case requires that BaseCheck class and classes which inherits from it needs to have scope_types defined thus Neutron can set it for the Check based on the defined policy rule. This patch adds scope_types attribute to the BaseCheck class to make it available for use cases like described above. Related-Bug: #1923503 Change-Id: Ibf30d0ffa5e9b125742089705d3557c02a03bc43 --- oslo_policy/_checks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oslo_policy/_checks.py b/oslo_policy/_checks.py index 3d00e6f..5246c2a 100644 --- a/oslo_policy/_checks.py +++ b/oslo_policy/_checks.py @@ -83,6 +83,8 @@ def _check(rule, target, creds, enforcer, current_rule): class BaseCheck(metaclass=abc.ABCMeta): """Abstract base class for Check classes.""" + scope_types = None + @abc.abstractmethod def __str__(self): """String representation of the Check tree rooted at this node.""" -- cgit v1.2.1