User is able to leave an organization

Problem

Users can be removed from Organizations. Similarly, they should have a right to leave an Organization.

Proposal

  • Add an option to Leave Organization. Where should this be located?
  • Leaving an Organization should remove a user as a member from all the groups and projects contained by the Organization.
  • User is warned about the consequences of leaving the Organization.
  • The user account stays intact.
  • As a result of leaving, the user loses member privileges for all the groups and projects contained in the Organization.
  • If the user is a member of more than 1 Organization, the Organization that the user left will not be available in the Organization switcher any longer.
  • If the user is a member of only 1 Organization and leaves that Organization, they are added to the default Organization instead.

Add ellipse menu to organization homepage

image.png

Clicking the ellipse opens a menu with an option to leave the organization

image.png

Clicking Leave organization opens a confirmation modal

image.png

If the user is the sole owner of a group prevent leaving and display the following modal

image.png

If the user is the sole owner of an organization prevent leaving and display the following modal

image

Future iteration image

Implementation plan

  1. Add leave action to app/assets/javascripts/vue_shared/components/list_actions/constants.js
  2. Render app/assets/javascripts/vue_shared/components/list_actions/list_actions.vue in app/assets/javascripts/organizations/users/components/users_view.vue by using the user-actions slot in <users-table>
  3. Add action: this.onActionLeave and text: Leave organizationto leave action and then pass toactions` prop
  4. In onActionLeave open a GlModal
  5. Check permissions added in #441577 (closed) to determine what the modal should say.
  6. If user confirms use GraphQL Mutation in #423005 to remove the organization user
Edited by Peter Hegman