Prevent unauthorized users from adding, selecting or archiving designs in work item design widget

What does this MR do and why?

When a user does not have permission to add designs, prevent them from seeing the "Add" button in the work item design widget.

When the user does not have permission to update designs, prevent them from seeing the the "Archive" button, the "Archive all" button, and the checkbox to select designs.

When a user does not have permission to update designs, also prevent them from seeing the archive button on a design detail modal.

If a user attempts these actions today while they do not have permission then the action will fail, but we should not show these affordances when the user does not have permission.

References

Screenshots or screen recordings

Before After
gdk.test_3000_flightjs_Flight_-issues_43__18 gdk.test_3000_flightjs_Flight_-issues_43__17
gdk.test_3000_flightjs_Flight_-issues_43__20 gdk.test_3000_flightjs_Flight_-issues_43__19

How to set up and validate locally

  1. Check out this branch
  2. Visit a work item that has at least 1 design added, or add a design to a work item
  3. Copy the URL and open it in an incognito window
  4. You will see that as a user with no permission, you do not see the Add button on the design widget, the checkbox to select design(s), the "Select all" or "Archive selected" buttons.
  5. Click on a design to open the design details modal
  6. You will see that the "Archive" icon button is not present in the design toolbar when you are not allowed to update the design.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Chad Lavimoniere

Merge request reports

Loading