You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Hamlet index page should list not only the projects that the current user is an owner of, but also the projects they're collaborators on.
Dev Notes
I'm thinking it's this bit in hamlet/views.py that needs to be changed:
@login_required
def index(request):
with social_context(request) as p:
context = {
'projects': Project.where(owner=request.user.username),
}
return render(request, 'index.html', context)
I'm assuming that .where() is some sort of, uh, NumPy function so it needs to be transformed into something like Project.where(owner=request.user.username|collaborator=request.user.username)(link)
❗ Follow up is required: once the index page lists projects a user is a collaborator of, make sure collaborators actually have permission to view (or edit(?)) those resources. I assume this is already handled by hamlet/zooniverse_auth.py's collab_for_project() but best to check.
Status
Important, but not urgent.
@adammcmaster Is there any reason this added functionality would be a bad idea?
The text was updated successfully, but these errors were encountered:
I think this makes sense to implement, and you're right that that Project query is the only place that needs to be updated. Everything else will work without any changes (and actually it already works if the user types the project ID into the URL manually for any project they have permissions for in the API).
The .where() function is actually a Python client function which will translate any arguments you give it into the query string of the API request. I'm not sure whether you can query for both owner and collaborator in one go or if you'd need to do two queries and combine the results.
Functionality Expansion
The Hamlet index page should list not only the projects that the current user is an owner of, but also the projects they're collaborators on.
Dev Notes
I'm thinking it's this bit in
hamlet/views.py
that needs to be changed:I'm assuming that
.where()
is some sort of, uh, NumPy function so it needs to be transformed into something likeProject.where(owner=request.user.username|collaborator=request.user.username)
(link)❗ Follow up is required: once the index page lists projects a user is a collaborator of, make sure collaborators actually have permission to view (or edit(?)) those resources. I assume this is already handled by
hamlet/zooniverse_auth.py
'scollab_for_project()
but best to check.Status
Important, but not urgent.
@adammcmaster Is there any reason this added functionality would be a bad idea?
The text was updated successfully, but these errors were encountered: