ucb-rit / coldfront

HPC Resource Allocation System
https://coldfront.readthedocs.io
GNU General Public License v3.0
3 stars 3 forks source link

Disallow users from making requests until first/last name are filled in #605

Open matthew-li opened 3 months ago

matthew-li commented 3 months ago

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.

matthew-li commented 2 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.

matthew-li commented 2 weeks ago

@helbashandy Some additional relevant views: