Fix 'Assign yourself' visibility for users without permissions

What does this MR do and why?

Related to #371020 (closed)

The new assignees widget showed the Assign yourself button even for users that don't have permissions.

This MR fixes that.

Screenshots or screen recordings

Without the changes

User access Issue sidebar Board sidebar
Reporter+ Schermata_2022-08-26_alle_16.24.18 Schermata_2022-08-26_alle_16.23.55
None/Guest Schermata_2022-08-26_alle_16.25.01 Schermata_2022-08-26_alle_16.24.55

With the changes

User access Issue sidebar Board sidebar
Reporter+ Schermata_2022-08-26_alle_16.17.41 Schermata_2022-08-26_alle_16.17.21
None/Guest Schermata_2022-08-26_alle_16.18.14 Schermata_2022-08-26_alle_16.18.32

How to set up and validate locally

  1. Make sure the :issue_assignees_widget feature flag is enabled
    • Open rails console with gdk rails c
    • Run Feature.enabled?(:issue_assignees_widget)
    • If the previous command returned false, run Feature.enable(:issue_assignees_widget)
  2. Log in or impersonate a user
  3. Find a project the user is not a member of or has guest access
  4. Find an issue that is not assigned to anyone
  5. The Assign yourself button should not be visible on the sidebar

MR acceptance checklist

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

Merge request reports

Loading