summaryrefslogtreecommitdiff
path: root/heat
diff options
context:
space:
mode:
Diffstat (limited to 'heat')
-rw-r--r--heat/common/policy.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/heat/common/policy.py b/heat/common/policy.py
index 4707c9673..312608c93 100644
--- a/heat/common/policy.py
+++ b/heat/common/policy.py
@@ -51,6 +51,8 @@ class Enforcer(object):
# register rules
self.enforcer.register_defaults(policies.list_rules())
+ self.file_rules = self.enforcer.file_rules
+ self.registered_rules = self.enforcer.registered_rules
def set_rules(self, rules, overwrite=True):
"""Create a new Rules object based on the provided dict of rules."""
@@ -118,6 +120,13 @@ class Enforcer(object):
is_registered_policy=True)
+def get_policy_enforcer():
+ # This method is used by oslopolicy CLI scripts to generate policy
+ # files from overrides on disk and defaults in code.
+ CONF([], project='heat')
+ return get_enforcer()
+
+
def get_enforcer():
global ENFORCER
if ENFORCER is None: