Loading services/webapp/code/rosetta/core_app/api.py +8 −3 Original line number Diff line number Diff line Loading @@ -440,10 +440,11 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI): # Get the storage based on the "root" folder name # TODO: this is extremely weak.. storage_id = path.split('/')[1] storage_name = storage_id.split('@')[0] try: computing_name = storage_id.split('@')[1] computing_name = storage_id.split(':')[0] storage_name = storage_id.split(':')[1] except IndexError: storage_name = storage_id computing_name = None # Get all the storages this user has access to: Loading Loading @@ -725,6 +726,10 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI): # Get storages storages = list(Storage.objects.filter(group=None)) + list(Storage.objects.filter(group__user=request.user)) # Oder storages (re-orderded in the file manager anyway) storages.sort(key=lambda storage: storage.id) # Prepare the output for storage in storages: # For now, we only support generic posix, SSH-based storages Loading services/webapp/code/rosetta/core_app/models.py +1 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,7 @@ class Storage(models.Model): @property def id(self): return (self.name if not self.computing else '{}@{}'.format(self.name,self.computing.name)) return (self.name if not self.computing else '{}:{}'.format(self.computing.name,self.name)) Loading Loading
services/webapp/code/rosetta/core_app/api.py +8 −3 Original line number Diff line number Diff line Loading @@ -440,10 +440,11 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI): # Get the storage based on the "root" folder name # TODO: this is extremely weak.. storage_id = path.split('/')[1] storage_name = storage_id.split('@')[0] try: computing_name = storage_id.split('@')[1] computing_name = storage_id.split(':')[0] storage_name = storage_id.split(':')[1] except IndexError: storage_name = storage_id computing_name = None # Get all the storages this user has access to: Loading Loading @@ -725,6 +726,10 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI): # Get storages storages = list(Storage.objects.filter(group=None)) + list(Storage.objects.filter(group__user=request.user)) # Oder storages (re-orderded in the file manager anyway) storages.sort(key=lambda storage: storage.id) # Prepare the output for storage in storages: # For now, we only support generic posix, SSH-based storages Loading
services/webapp/code/rosetta/core_app/models.py +1 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,7 @@ class Storage(models.Model): @property def id(self): return (self.name if not self.computing else '{}@{}'.format(self.name,self.computing.name)) return (self.name if not self.computing else '{}:{}'.format(self.computing.name,self.name)) Loading