Skip to content

Commit

Permalink
Merge pull request #28 from whdalsrnt/master
Browse files Browse the repository at this point in the history
refactor: change authorization scope
  • Loading branch information
whdalsrnt authored Aug 23, 2022
2 parents e951bdc + c16e0dc commit 2affc28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
3 changes: 0 additions & 3 deletions src/spaceone/config/model/user_config_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class UserConfig(MongoModel):
'minimal_fields': [
'name'
],
'change_query_keys': {
'user_self': 'user_id'
},
'ordering': [
'name'
],
Expand Down
17 changes: 5 additions & 12 deletions src/spaceone/config/service/user_config_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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):
"""
Expand Down

0 comments on commit 2affc28

Please sign in to comment.