summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlawek Kaplonski <skaplons@redhat.com>2021-10-05 11:09:31 +0200
committerSlawek Kaplonski <skaplons@redhat.com>2021-10-05 11:19:50 +0200
commitfb51982f80572c73fc8dcaf2818a0ad31663a11e (patch)
treef0edcacb02887f2e101906f69647ae1fccee66ef
parent4f0e206a12040a0643816c3a14585160408a9f5d (diff)
downloadoslo-policy-fb51982f80572c73fc8dcaf2818a0ad31663a11e.tar.gz
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
-rw-r--r--oslo_policy/_checks.py2
1 files changed, 2 insertions, 0 deletions
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."""