summaryrefslogtreecommitdiff
path: root/nova/context.py
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2016-09-12 21:39:45 -0400
committerAdam Young <ayoung@redhat.com>2016-09-12 21:39:45 -0400
commit304bc201c004d549de408c75cfe731eb65fde78d (patch)
tree2386cd48a9b12f4f0cbd3f9b153d594ffbc3aac0 /nova/context.py
parentba718e35db3275f66647690e3d5b31614f228639 (diff)
downloadnova-304bc201c004d549de408c75cfe731eb65fde78d.tar.gz
Use to_policy_values for policy credentials
The base oslo.context defines to_policy_values with all the information that it expects a service to require to enforce policy. Use that instead of throwing everything in to_dict at policy enforcement. Change-Id: I0a42b4425e9dd1bd062c48792c4d116dd370afe3 Closes-Bug: #1602081
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/context.py b/nova/context.py
index 5d464f034f..4d5854261c 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -277,6 +277,11 @@ class RequestContext(context.RequestContext):
raise
return False
+ def to_policy_values(self):
+ policy = super(RequestContext, self).to_policy_values()
+ policy['is_admin'] = self.is_admin
+ return policy
+
def __str__(self):
return "<Context %s>" % self.to_dict()