Skip to content

Commit

Permalink
controlled datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Oct 24, 2023
1 parent 0603b55 commit 9dd3c7a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 1 addition & 2 deletions beacon/request/public_datasets.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
public_datasets:
- CINECA_synthetic_cohort_EUROPE_UK1
- AV_Dataset
- AV_Dataset
2 changes: 2 additions & 0 deletions permissions/controlled_datasets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
controlled_datasets:
- CINECA_synthetic_cohort_EUROPE_UK1
4 changes: 3 additions & 1 deletion permissions/permissions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ app-user3: []
gemma_test: []
jane:
- GiaB
jofrdo:
jofrdo: null
john:
- GiabV
- dataset-registered
- dataset-controlled
new_user:
- GiaB
usuari_creat:
- hola
11 changes: 10 additions & 1 deletion permissions/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ async def initialize(self):

async def get(self, username, requested_datasets=None):
try:
datasets = set(self.db.get(username))
with open("/beacon/permissions/controlled_datasets.yml", 'r') as file:
controlled_datasets = yaml.safe_load(file)
file.close()
list_controlled_datasets = controlled_datasets['controlled_datasets']
datasets = []
for cdataset in list_controlled_datasets:
datasets.append(cdataset)
for pdataset in self.db.get(username):
datasets.append(pdataset)
datasets = set(datasets)
except Exception:
with open("/beacon/permissions/permissions.yml", 'r') as stream:
permissions_dict = yaml.safe_load(stream)
Expand Down

0 comments on commit 9dd3c7a

Please sign in to comment.