From c16e0dc91353d1d158b8ce37e77966828fd4dcf0 Mon Sep 17 00:00:00 2001 From: Jongmin Kim Date: Tue, 23 Aug 2022 21:29:59 +0900 Subject: [PATCH] refactor: change authorization scope Signed-off-by: Jongmin Kim --- src/spaceone/config/model/user_config_model.py | 3 --- .../config/service/user_config_service.py | 17 +++++------------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/spaceone/config/model/user_config_model.py b/src/spaceone/config/model/user_config_model.py index f307a2f..fb94910 100644 --- a/src/spaceone/config/model/user_config_model.py +++ b/src/spaceone/config/model/user_config_model.py @@ -22,9 +22,6 @@ class UserConfig(MongoModel): 'minimal_fields': [ 'name' ], - 'change_query_keys': { - 'user_self': 'user_id' - }, 'ordering': [ 'name' ], diff --git a/src/spaceone/config/service/user_config_service.py b/src/spaceone/config/service/user_config_service.py index a308638..23a348d 100644 --- a/src/spaceone/config/service/user_config_service.py +++ b/src/spaceone/config/service/user_config_service.py @@ -137,12 +137,9 @@ def get(self, params): return self.user_config_mgr.get_user_config(params['name'], user_id, params['domain_id'], params.get('only')) - @transaction(append_meta={ - 'authorization.scope': 'USER', - 'mutation.append_parameter': {'user_self': {'meta': 'user_id', 'data': [None]}} - }) + @transaction(append_meta={'authorization.scope': 'USER'}) @check_required(['domain_id']) - @append_query_filter(['name', 'user_id', 'domain_id', 'user_self']) + @append_query_filter(['name', 'user_id', 'domain_id']) @append_keyword_filter(['name']) def list(self, params): """ List user configs @@ -151,8 +148,7 @@ def list(self, params): params (dict): { 'name': 'str', 'domain_id': 'str', - 'query': 'dict (spaceone.api.core.v1.Query)', - 'user_self': 'list', // from meta + 'query': 'dict (spaceone.api.core.v1.Query)' } Returns: @@ -163,12 +159,9 @@ def list(self, params): query = params.get('query', {}) return self.user_config_mgr.list_user_configs(query) - @transaction(append_meta={ - 'authorization.scope': 'USER', - 'mutation.append_parameter': {'user_self': {'meta': 'user_id', 'data': [None]}} - }) + @transaction(append_meta={'authorization.scope': 'USER'}) @check_required(['query', 'domain_id']) - @append_query_filter(['domain_id', 'user_self']) + @append_query_filter(['domain_id']) @append_keyword_filter(['name']) def stat(self, params): """