Skip to content

Show "Invite members" link on work item only with correct permission

Natalia Tepluhina requested to merge ntepluhina-fix-invite-members into master

What does this MR do and why?

Previously, on work item view, any user could see Invite members link in assignees dropdown. This MR fixes this behaviour to only show the link if the user has a permission to invite new members

Screenshots or screen recordings

Screenshots for the user without permission to invite members:

Before After
Screenshot_2022-08-15_at_09.44.43 Screenshot_2022-08-15_at_09.43.07

How to set up and validate locally

  1. Enable work items feature flag:

    Feature.enable(:work_items)
  2. Enable the work items MVC 2 feature flag

    Feature.enable(:work_items_mvc_2)
  3. Open work item view

  4. Click on the assignees field

  5. Check if Invite members link is present

  6. Log out and log in with the user that is not a maintainer for a project.

  7. Open dropdown again, you should not see Invite members link

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Natalia Tepluhina

Merge request reports