summaryrefslogtreecommitdiff
path: root/nova/context.py
diff options
context:
space:
mode:
authorjichenjc <jichenjc@cn.ibm.com>2016-11-28 04:06:26 +0800
committerjichenjc <jichenjc@cn.ibm.com>2016-11-28 04:07:12 +0800
commit8d4eac270a527073dd7f97a3771f69c5873a13a9 (patch)
tree9b1b250f17e94f43076f81a7e4719241f6c25ea5 /nova/context.py
parent474c2ef28234dacc658e9a78762cac66ef7fe334 (diff)
downloadnova-8d4eac270a527073dd7f97a3771f69c5873a13a9.tar.gz
Remove require_admin_context
this function was used to put into db layer to ensure the request has admin context or a unauthorized exception will be raised, this is not needed as we already move all this kind of check into api layer and policy functions. Change-Id: Ia411e6715e4c584952a275a001f1791ca1352d97
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/nova/context.py b/nova/context.py
index f97f54c4b2..68dcdad618 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -323,12 +323,6 @@ def is_user_context(context):
return True
-def require_admin_context(ctxt):
- """Raise exception.AdminRequired() if context is not an admin context."""
- if not ctxt.is_admin:
- raise exception.AdminRequired()
-
-
def require_context(ctxt):
"""Raise exception.Forbidden() if context is not a user or an
admin context.