NEMO
NEMO copied to clipboard
[Feature request] Allow users to modify their own profiles (and edit groups)
Hello,
At UC Irvine we've implemented a customization to allow users to edit their own profiles. Clicking your name in the navbar will take you to /user/{user_id}/
where user_id
is your own user id.
We also added functionality to create_or_modify_user
to allow users to add and remove themselves from groups (just like projects). Maybe this should be a different feature request / PR?
What do you think would be a good way to implement this feature? It appears the "Modify user" page is geared towards staff currently. Maybe there could be a setting to allow users to edit their own profiles. Thanks!
Hello, That's an interesting idea, but I am not sure users should be able to modify many of the fields. In fact, I don't think they should be able to modify anything except for their first and last name possibly. The username is their unique identifier, used for ldap login and other authentication a lot, and would be a pretty big issue if they could change it. Also badge number, access expiration, whether they are active and/or need to complete the facility rules tutorial, their projects and tool qualifications would also present a lot of issues if they could modify them.
So if I were to do that, I would put it in a separate page, or probably just stick it in the preferences page.
Are the groups django authentication groups? or some other kind of group you created?
Hi @rptmat57,
Yeah I see the issue with allowing users to edit a lot of those fields. The groups are from django.contrib.auth.models
. It's the groups
relationship in the NEMO User
class.
Ah this is an important note that I forgot. If the user is not user.is_any_part_of_staff
we set the form to readonly
. Though it looks like "Projects" is still editable.
Staff can still edit all the fields like shown above.
Oh I see, if it's just a read only user profile page, that might be useful. it would have to be turned off by default and have an option in Customization. Not sure if the badge number should be hidden or not
Regarding the groups, this functionality is available in the NEMO-User-details plugin: https://gitlab.com/nemo-community/atlantis-labs/nemo-user-details
Hello!
We've worked a bit on having a separate page for readonly users to view and have come up with the following:
For UCI we need our non staff users to assign their own projects, but would a readonly view without editing be useful for NEMO?
Hi, Yes, I think that would be extremely useful. It would allow users to see their information and potential report any missing projects/tools etc. In the future, I could see using that page to allow users to hide/show and order projects in case they don't use some of them very often, etc.
Hi! I've got the PR together here: https://github.com/usnistgov/NEMO/pull/229
I've added a staff check to send staff to the original user edit page, whereas users get sent to the readonly page. Let me know if there's any changes we can make. Thanks!
One small issue I ran across is that when a staff member clicks on the link in the "Welcome, User" it will use the view_user url but send them to the create_or_modify_user page. I will look into ways to redirect to the correct url, but if you have any insight on how to easily fix that please let me know.
Hi @rptmat57,
I see that the PR has been merged, thanks! I was wondering if in the future you could see there being an option to allow users to edit aspects of their profile? Admin would have to opt-in on the customizations page. For example at UC Irvine, an option to allow users to edit their projects (add/remove) would be helpful. I understand that the page being read-only (at least by default) is desired.
Thanks, Aaron
Hi @abuckles-uci, Honestly, I highly doubt letting users edit their own projects will ever be an option. It would lead to so many issues, with users charging other projects without approval, etc.
I am going to close this issue. We can always reopen it if things change
I understand. Thank you for the response!