From a2b778942b2ba22b5acfa4d0e175ebb70337d044 Mon Sep 17 00:00:00 2001 From: Alexander VanTol Date: Mon, 21 Oct 2019 16:42:51 -0500 Subject: [PATCH] chore(refactor): clarify cfg comments, consolidate logic for getting all projects --- fence/config-default.yaml | 2 +- fence/sync/sync_users.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fence/config-default.yaml b/fence/config-default.yaml index 9e28eb3ff..7e94ea3b5 100644 --- a/fence/config-default.yaml +++ b/fence/config-default.yaml @@ -408,7 +408,7 @@ dbGaP: # 'studyZ': 'test_common_exchange_area' # A mapping from the dbgap study / Fence project to which authorization namespaces the # actual data lives in. For example, `studyX` data may exist in multiple organizations, so - # we need to know to map authorization to all orgs resources + # we need to know how to map authorization to all orgs resources study_to_resource_namespaces: '_default': ['/'] 'test_common_exchange_area': ['/dbgap/'] diff --git a/fence/sync/sync_users.py b/fence/sync/sync_users.py index 03509cde5..07aaf6f00 100644 --- a/fence/sync/sync_users.py +++ b/fence/sync/sync_users.py @@ -465,8 +465,8 @@ def _parse_csv(self, file_dict, sess, encrypted=True): # c999 indicates full access to all consents and access # to a study-specific exchange area - # access to at least one study-specific exchange implies access - # to the common exchange area + # access to at least one study-specific exchange area implies access + # to the parent study's common exchange area # # NOTE: Handling giving access to all consents is done at # a later time, when we have full information about possible @@ -1083,10 +1083,8 @@ def _grant_all_consents_to_c999_users( access_number_matcher = re.compile(config["DBGAP_ACCESSION_WITH_CONSENT_REGEX"]) # combine dbgap/user.yaml projects into one big list (in case not all consents # are in either) - all_projects = [] - all_projects.extend([project for project, _ in self._projects.items()]) - all_projects.extend( - [project for project, _ in user_yaml_project_to_resources.items()] + all_projects = set( + list(self._projects.keys()) + list(user_yaml_project_to_resources.keys()) ) self.logger.debug(f"all projects: {all_projects}")