Skip to content

Commit

Permalink
chore(refactor): clarify cfg comments, consolidate logic for getting …
Browse files Browse the repository at this point in the history
…all projects
  • Loading branch information
Avantol13 committed Oct 21, 2019
1 parent 91f53f0 commit a2b7789
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fence/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/']
Expand Down
10 changes: 4 additions & 6 deletions fence/sync/sync_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit a2b7789

Please sign in to comment.