From 8d4eac270a527073dd7f97a3771f69c5873a13a9 Mon Sep 17 00:00:00 2001 From: jichenjc Date: Mon, 28 Nov 2016 04:06:26 +0800 Subject: [PATCH] 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 --- nova/context.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nova/context.py b/nova/context.py index f97f54c4b20b..68dcdad61842 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.