Skip to content

Commit

Permalink
fixing permissions bug
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Nov 8, 2023
1 parent 9d4393d commit 62973cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions permissions/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DummyPermissions(Permissions):

def __init__(self, *args, **kwargs):
# Dummy permission database
with open("/beacon/permissions/permissions.yml", 'r') as stream:
with open("/beacon/permissions/registered_datasets.yml", 'r') as stream:
out = yaml.safe_load(stream)
self.db = out

Expand Down Expand Up @@ -75,10 +75,10 @@ async def get(self, username, requested_datasets=None):
datasets.append(rdataset)
datasets = set(datasets)
except Exception:
with open("/beacon/permissions/permissions.yml", 'r') as stream:
with open("/beacon/permissions/registered_datasets.yml", 'r') as stream:
permissions_dict = yaml.safe_load(stream)
permissions_dict[username]=[]
with open("/beacon/permissions/permissions.yml", 'w') as file:
with open("/beacon/permissions/registered_datasets.yml", 'w') as file:
yaml.dump(permissions_dict, file)
self.db = permissions_dict
datasets = set(self.db.get(username))
Expand Down

0 comments on commit 62973cd

Please sign in to comment.