summaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone
diff options
context:
space:
mode:
authorWuKong <rebirthmonkey@gmail.com>2015-07-09 16:13:11 +0200
committerWuKong <rebirthmonkey@gmail.com>2015-07-09 16:13:11 +0200
commit690e8ca72a1494fb50e3d00efa47c29039598314 (patch)
treed96892beb0d6654478d98604ff2dd6ea71c18458 /keystone-moon/keystone
parent7431cf0b277b34325dee4002ee18b54c89417963 (diff)
update controller interface
Change-Id: I3b08007d3becf13787791631bc154ce1745c854a Signed-off-by: WuKong <rebirthmonkey@gmail.com>
Diffstat (limited to 'keystone-moon/keystone')
-rw-r--r--keystone-moon/keystone/contrib/moon/controllers.py17
1 files changed, 8 insertions, 9 deletions
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')