Skip to content

Commit 62b52e6

Browse files
authored
Merge pull request #23 from EGA-archive/urgent-fix
querying datasets into source database
2 parents b3fc9fd + f6bb504 commit 62b52e6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

beacon/permissions/__main__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
from beacon.auth.__main__ import authentication
99
from beacon.logs.logs import log_with_args
1010
from beacon.conf.conf import level
11-
from beacon.connections.mongo.datasets import get_list_of_datasets
11+
from beacon.source.manage import datasets
12+
13+
source=datasets['database']
14+
complete_module='beacon.connections.'+source+'.datasets'
15+
import importlib
16+
module = importlib.import_module(complete_module, package=None)
1217

1318
@log_with_args(level)
1419
async def authorization(self, request, headers):
@@ -48,11 +53,11 @@ async def get_datasets_list(self, qparams, request: Request, authorized_datasets
4853
for elemento in specific_datasets:# pragma: no cover
4954
if elemento not in search_and_authorized_datasets:
5055
specific_datasets_unauthorized.append(elemento)
51-
beacon_datasets = get_list_of_datasets(self)# pragma: no cover
56+
beacon_datasets = module.get_list_of_datasets(self)# pragma: no cover
5257
response_datasets = [ r['id'] for r in beacon_datasets if r['id'] in search_and_authorized_datasets]# pragma: no cover
5358

5459
else:
55-
beacon_datasets = get_list_of_datasets(self)
60+
beacon_datasets = module.get_list_of_datasets(self)
5661
specific_datasets = [ r['id'] for r in beacon_datasets if r['id'] not in authorized_datasets]
5762
response_datasets = [ r['id'] for r in beacon_datasets if r['id'] in authorized_datasets]
5863
specific_datasets_unauthorized.append(specific_datasets)

0 commit comments

Comments
 (0)