singularityhub / sregistry

server for storage and management of singularity images
https://singularityhub.github.io/sregistry
Mozilla Public License 2.0
103 stars 42 forks source link

Allow admin to add contributors to collection without team #280

Open RonaldEnsing opened 4 years ago

RonaldEnsing commented 4 years ago

The Settings page of the collection shows the option to remove owners from the collection. There is also an Add Contributors section, but it does not show any existing users that can be added. I followed the procedure as listed here https://singularityhub.github.io/sregistry/docs/accounts/robots as a workaround. However, I would assume that it should be possible to add users in the web interface since a section is shown to add contributors.

vsoch commented 4 years ago

It's not super intuitive how it works, here is the interface for future us to see:

image

In order to add anyone, you need to make a team first. Once they are part of the team, then they appear as options there. This is to somewhat protect privacy of users, because if I allowed any random user to search / find any other user in the registry, it seems like a violation of privacy. Instead, joining a team with the user is a statement / declaration of working together, and then those contributors will appear as options. There is some documentation here https://singularityhub.github.io/sregistry/docs/interface in case it helps!

RonaldEnsing commented 4 years ago

Ah I see your point, but is that also needed if the admin user wants to add contributors?

vsoch commented 4 years ago

The way I think about these registries is that there is an admin / superuser team, but the containers should be maximally owned by the user. I think in your case you have this special "robot user" and you want to add yourself to the collection? It seems like a reasonable need, but since it's a more niche use case I think it would still work for you to make a team including the bot, and then add who is needed. If you want to share the details of your specific use case I'd be happy to help you brainstorm possible solutions.

RonaldEnsing commented 4 years ago

I do not have the need to share a collection with multiple teams or the need to have multiple collections owned by one team. So I have a collection that I want to share with different users (including a robot user) and I feel that making a team would only add unnecessary complexity. I would simply like to add individual contributors to the collection. I see your point of privacy, however, as the admin user I think that this should be possible from the web interface. The admin has the access anyway with the manage.py interface.

vsoch commented 4 years ago

I understand your use case, but I don't feel strongly about adding this niche case at the moment because it goes against the design philosophy I had for Teams in the first place, and it's also not the most pressing issue for Singularity Registry Server to work on, and I only have so many extra hours in a day. I'm happy to leave this open for now, and if many other users come and +1, when my queue clears up it could be addressed in the future. For the time being, I've written up an example script that shows how to use manage.py. https://singularityhub.github.io/sregistry/docs/interface#admin-control-of-teams.

if you feel very strongly about this you are welcome to open a pull request that implements the change, I'd be happy to review it. You would need to refactor the view to have custom rendering logic basic on the user being a superuser, and then on submit, ensuring that the posts for a superuser / regular user both still function.