Manage own group membership

Hello Guys,

is there any scope, which allows users to manage their own group membership?

For example User A is in Group 1, and he can do the following things:

  1. See some groups including his own group
  2. Get out of the current group
  3. Join in a group in admin ui, if he does not belong to any group
  4. He can not see and change other users` group membership,

I tried following scope for User A, but he can still see all members in his group, and also kick others out of the group

  1. admin-ui and manage group → “admin-ui”
  2. see some group → “groups!group=group1,group2,group3”

I can’t think of a way to do it. Can you explain why you want to do this though? In your scenario an administrator needs to define which groups a user is allowed to join, so why not add them to those groups in the first place?

Short answer is there’s currently no scope that represents managing a specific user’s group membership, only groups for managing all members of a group.

Permitting users to join groups is equivalent to granting users permission to grant themselves permissions, e.g. making themselves admins of the hub, which wouldn’t be desirable.

Permitting users to leave groups is more feasible, since it isn’t tied to privilege escalation.

But it would be useful to have more background on what you’re hoping to accomplish by allowing users to join groups at a higher level to see if we can come up with something that can work.

Hello Manics and Minrk,

Thank you both for your replys.
This is my scenario:

in our courses, there are many students. We want them to group themselfs and join the jupyterhub. I have created 10 student groups at first place. We let the students make their own choice, which group to join in.

It will be very convinient for me, if they (students) can just mange their own membership. Otherwise, students have to send me an email, tell me which group he/she wants to join in. And i have to do it manuelly in admin UI.

What is the intended effect of joining the groups? Do you want students to be able to change groups at will at any time and join multiple groups?

I think this is going to be hard to represent in permissions of the base JupyterHub API. However, you could operate a service with group management permissions that would apply the logic you want and perform the group management operations.

This could apply restrictions like:

  • only one group at a time per student
  • allow switching groups (or not)
  • group size limits
  • only allow joining specific groups
  • halt the service after group selection window is over

I realize writing a service is probably not what you want, but it could be a single-page application that only serves a signle form.

2 Likes

Hello Minrk,

Thanks a lot for giving me a possible solution. I will try it out some time: )