Skip to content

Assign additional Organization Owners

Problem

Once the initial Organization Owner is assigned correctly during Organization creation, we want to enable that Owner to assign additional Organization Owners.

Possible solution

We could use the current Admin Area flow to inspire the flow to assign an additional Organization Owner.

  • New user: Admin will go to Admin Area > Users, and create a new user, at that time they can set them as an instance admin or regular user in the creation form.
  • Existing user: Admin will got to the Admin Area > Users, and edit an existing user. At that time they can set them as an instance admin or regular user in the edit form.

Proposal

Add a column to the Organization users list to display/edit the role of the user. To make room we will need need to remove the Created on column.

image.png

  • Selectable roles are Owner and User
  • Only Organization Owners have access to Organization > Users
  • Only Organization Owners can change the role of a user

Implementation guide

  1. Add an organizationRole field to app/assets/javascripts/vue_shared/components/users_table/users_table.vue. Expose a slot to render this field.
  2. Add a fieldsToRender prop to app/assets/javascripts/vue_shared/components/users_table/users_table.vue
  3. Add the ability checked in #478031 (closed) to app/graphql/types/permission_types/organization_user.rb
  4. In app/assets/javascripts/organizations/users/components/users_view.vue check if the user has permission to change a user's role. If they do, render a dropdown, if they don't render their role in text.
  5. When the dropdown is changed, put in loading state, make call to GraphQL mutation added in #478031 (closed), render success toast.
  6. Use the fieldsToRender prop to show organizationRole field and to hide createdAt field
Edited by Peter Hegman