From 141e16fcbdcacc02ff30d861bf76082b51d4c287 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Thu, 16 Nov 2017 14:51:29 +0530 Subject: Update and Delete functionalities for projects Implemented the update and delete functions for the projects and wrote the e2e tests for the both functions. Change-Id: I917dd9503f145b0dde61dd9970bd855f9711335e Signed-off-by: thuva4 --- testapi/opnfv_testapi/common/check.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'testapi/opnfv_testapi/common') diff --git a/testapi/opnfv_testapi/common/check.py b/testapi/opnfv_testapi/common/check.py index 432a6c1..1155d24 100644 --- a/testapi/opnfv_testapi/common/check.py +++ b/testapi/opnfv_testapi/common/check.py @@ -28,10 +28,17 @@ def is_authorized(method): user_info = yield dbapi.db_find_one('users', {'user': testapi_id}) if not user_info: raises.Unauthorized(message.not_lfid()) - kwargs['owner'] = testapi_id + if "owner" in kwargs: + kwargs['owner'] = testapi_id if self.table in ['projects']: query = kwargs.get('query') - query_data = query() + if type(query) is not dict: + query_data = query() + else: + if self.json_args is None: + query_data = query + else: + query_data = self.json_args group = "opnfv-gerrit-" + query_data['name'] + "-submitters" if group not in user_info['groups']: raises.Unauthorized(message.no_permission()) -- cgit 1.2.3-korg