Added support to profile-show

This commit is contained in:
tengqm 2015-01-20 23:37:00 +08:00
parent e45b0afe57
commit 84304a81ae
3 changed files with 8 additions and 3 deletions

View File

@ -13,5 +13,6 @@
"policy_types:index": "", "policy_types:index": "",
"profiles:index": "rule:admin_or_owner", "profiles:index": "rule:admin_or_owner",
"profiles:create": "", "profiles:create": "",
"profiles:delete": "rule:admin_or_owner" "profiles:delete": "rule:admin_or_owner",
"profiles:get": "rule:admin_or_owner"
} }

View File

@ -150,6 +150,11 @@ class EngineService(service.Service):
profile.store(context) profile.store(context)
return profile.to_dict() return profile.to_dict()
@request_context
def profile_get(self, context, profile_id):
profile = profile_base.Profile.load(context, profile_id)
return profile
@request_context @request_context
def profile_update(self, context, profile_id, name, spec, perm, tags): def profile_update(self, context, profile_id, name, spec, perm, tags):
return {} return {}

View File

@ -104,8 +104,7 @@ class EngineClient(object):
def profile_get(self, ctxt, profile_id): def profile_get(self, ctxt, profile_id):
return self.call(ctxt, return self.call(ctxt,
self.make_msg('profile_get', self.make_msg('profile_get', profile_id=profile_id))
profile_id=profile_id))
def profile_update(self, ctxt, profile_id, name, spec, perm, tags): def profile_update(self, ctxt, profile_id, name, spec, perm, tags):
return self.call(ctxt, return self.call(ctxt,