From 690e8ca72a1494fb50e3d00efa47c29039598314 Mon Sep 17 00:00:00 2001 From: WuKong Date: Thu, 9 Jul 2015 16:13:11 +0200 Subject: update controller interface Change-Id: I3b08007d3becf13787791631bc154ce1745c854a Signed-off-by: WuKong --- keystone-moon/keystone/contrib/moon/controllers.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'keystone-moon/keystone') diff --git a/keystone-moon/keystone/contrib/moon/controllers.py b/keystone-moon/keystone/contrib/moon/controllers.py index 3c87da45..7de7cdf5 100644 --- a/keystone-moon/keystone/contrib/moon/controllers.py +++ b/keystone-moon/keystone/contrib/moon/controllers.py @@ -7,7 +7,7 @@ from keystone.common import controller from keystone.common import dependency from keystone import config from keystone.models import token_model -from keystone import exception +from keystone.contrib.moon.exception import * import os import glob from oslo_log import log @@ -23,19 +23,18 @@ class Authz_v3(controller.V3Controller): super(Authz_v3, self).__init__() @controller.protected() - def get_authz(self, context, tenant_id, subject_id, object_id, action_id): - # TODO (dthom): build the authz functionality + def get_authz(self, context, tenant_name, subject_name, object_name, action_name): try: - _authz = self.authz_api.authz(tenant_id, subject_id, object_id, action_id) - except exception.NotFound: + _authz = self.authz_api.authz(tenant_name, subject_name, object_name, action_name) + except TenantNotFound: _authz = True except: _authz = False return {"authz": _authz, - "tenant_id": tenant_id, - "subject_id": subject_id, - "object_id": object_id, - "action_id": action_id} + "tenant_name": tenant_name, + "subject_name": subject_name, + "object_name": object_name, + "action_name": action_name} @dependency.requires('admin_api', 'authz_api') -- cgit 1.2.3-korg