implement Workspace model
The App needs something like a Workspace
model that controls for which files the user can generate catalog entries, something like
class WorkSpace(models.Model):
"""Folder on the THREDDS server whose netCDF should me made available."""
name = models.CharField()
directory_thredds = models.FilePath(directory_only=True) # directory on the THREDDS container
directory_django = models.FilePath(directory_only=True) # directory on the Django container
groups = models.ManyToManyField(Group) # groups that are allowed to use this workspace
users = models.ManyToManyField(User) # users that are allowed to use this workspace
class File(models.Model):
workspace = models.ForeignKey(Workspace)
path = models.FilePathField() # path relative to the workspace
we can then provide auto-completion options for SimpleDataset
and DatasetScan
via django-select2
and use the interdependent selection option (not sure yet how well this works with the django admin)
using this workflow, we can prevent path traversals when users create new catalog entries