Open matthew-li opened 3 months ago
@helbashandy I think this would make a simple first issue to let you see/touch much of the codebase.
Most views in coldfront.core
inherit a mixin UserPassesTestMixin
which requires a function test_func
that determines whether the authenticated user can access the view (else 403).
It's probably worth considering placing checks like these (agreement being signed, names being filled, etc.) into a new mixin to avoid duplicate code.
I also want to document which views require what. Whether that belongs only in the code or has a place in our separate docs repo is a conversation for us to have.
@helbashandy Some additional relevant views:
coldfront.core.project.views.ProjectAddUsersView
.coldfront.core.project.templates.project.project_request.project_request.html
. Those landing pages themselves then link to the forms where the requests are actually made./project
: These users see an additional "Renew a PI's Allowance" button. You'd need to log in as a relevant user to see that.
CILogon is given first/last name information by the identity provider chosen by the user. In rare cases, the provider doesn't give one or the other of the names, so we have incomplete information.
In cases like these, users should be prevented from making most (all?) requests (especially requests to join/be added to a project and, by extension, gain access to the cluster) until they fill in both first/last names from the user profile page.
We already have checks for whether the user agreement is signed. Consider including checks like these in some kind of utility function/mixin to avoid code duplication.
It might also be useful to include a banner upon initial authentication alerting the user to do this.