Skip to content

Commit

Permalink
fix(revert): undo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Avantol13 committed Jun 27, 2019
1 parent e8d3a58 commit 880e6c2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions fence/blueprints/data/indexd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"gs": {"upload": "PUT", "download": "GET"},
}


SUPPORTED_PROTOCOLS = ["s3", "http", "ftp", "https", "gs"]
SUPPORTED_ACTIONS = ["upload", "download"]
ANONYMOUS_USER_ID = "anonymous"
Expand Down Expand Up @@ -350,14 +349,11 @@ def authz(self):
else:
raise Unauthorized("This file is not accessible")

def check_authz(self, action, token=None):
if token is None:
token = get_jwt()

def check_authz(self, action):
if not self.index_document.get("authz"):
raise ValueError("index record missing `authz`")

request = {"user": {"token": token}, "requests": []}
request = {"user": {"token": get_jwt()}, "requests": []}
for resource in self.index_document["authz"]:
request["requests"].append(
{"resource": resource, "action": {"service": "fence", "method": action}}
Expand All @@ -371,7 +367,7 @@ def metadata(self):

@cached_property
def public(self):
return self.check_public(self.authz)
return check_public(self.authz)

@login_required({"data"})
def check_authorization(self, action):
Expand Down Expand Up @@ -835,6 +831,6 @@ def filter_auth_ids(action, list_auth_ids):
return authorized_dbgaps


def check_public(self, authz):
def check_public(authz):
if "*" in authz or "/open" in authz:
return True

0 comments on commit 880e6c2

Please sign in to comment.