Skip to content

Commit 263d19d

Browse files
authored
Merge pull request #902 from hubmapconsortium/Derek-Furst/support-public-version
updated comment block for get_entity_accessibility to reflect changes
2 parents 6bd2371 + ef8440b commit 263d19d

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

src/app.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -588,22 +588,14 @@ class ReindexPriorityLevelEnum(Enum):
588588
def get_accessible_data_directories():
589589
dataset_helper = DatasetHelper()
590590

591-
# If not token is provided or an invalid token is provided, return a 401 error.
592-
if request.headers.get('Authorization') is None:
593-
unauthorized_error('A valid token must be provided.')
594-
595591
# If an invalid token provided, we need to tell the client with a 401 error, rather
596592
# than a 500 error later if the token is not good.
597593
_validate_token_if_auth_header_exists(request)
598594

599-
# Get user token from Authorization header
600-
# Get the user token from Authorization header
601-
user_token = auth_helper_instance.getAuthorizationTokens(request.headers)
602-
603595
# Get user group information which will be used to determine accessibility on
604596
# a per-entity basis.
605597
user_data_access_level = auth_helper_instance.getUserDataAccessLevel(request)
606-
598+
user_data_access_level['group_membership_ids'] = []
607599
if not request.is_json:
608600
bad_request_error("A json body and appropriate Content-Type header are required.")
609601
json_payload = request.get_json()

src/dataset_helper_object.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ def verify_dataset_title_info(self, dataset_uuid: str, user_token: str) -> array
121121

122122
return rslt
123123

124-
# entity_id - UUID or HM_ID
125-
# user_token - The authorization token for the user, which is used to generate an appropriate
126-
# description of the user's access to the entity.
124+
# neo4j_driver - The driver instance for neo4j
125+
# json_payload - A list of ids (HM_ID or UUID)
127126
# user_data_access_level - Data access level information for the user, notably including
128127
# Globus Group membership information.
129128
#
130-
# Returns a JSON Object containing accessibility information for the entity.
131-
#
132-
def get_entity_accessibility(self, neo4j_driver, json_payload, user_data_access_level: dict = None) -> dict:
129+
# Returns a Dict of Dicts where each of the dicts inside is keyed by its original id given
130+
# in the json_payload and contains information about the accessibility of that directory
131+
# including its globus url.
132+
def get_entity_accessibility(self, neo4j_driver, json_payload, user_data_access_level) -> dict:
133133
supported_entity_type_list = ['Dataset', 'Upload']
134134
accessibility_dicts = {}
135135

0 commit comments

Comments
 (0)