Skip to content

Commit

Permalink
Merge pull request #653 from uc-cdis/fix/public-files
Browse files Browse the repository at this point in the history
feat(public-files): check authz/acl field, then hit arborist as anon …
  • Loading branch information
Avantol13 committed Jun 28, 2019
2 parents 2c0edb7 + e0af39e commit ee6283c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fence/blueprints/data/indexd.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ def metadata(self):

@cached_property
def public(self):
return check_public(self.set_acls)
authz_resources = list(self.set_acls)
authz_resources.extend(self.index_document.get("authz", []))
return "*" in authz_resources or "/open" in authz_resources

@login_required({"data"})
def check_authorization(self, action):
Expand Down Expand Up @@ -827,8 +829,3 @@ def filter_auth_ids(action, list_auth_ids):
if checked_permission in values:
authorized_dbgaps.append(key)
return authorized_dbgaps


def check_public(set_acls):
if "*" in set_acls:
return True

0 comments on commit ee6283c

Please sign in to comment.