Skip to content

Update work items links permissions

Joseph Wambua requested to merge jj-451457-work-item-relation-permissions-b into master

What does this MR do and why?

When linking epic work items, we need to check whether the related_epics licensed feature flag is enabled in order to allow the admin_work_item_link policy.

Related to: #451457 (closed)

How to set up and validate locally

  1. To test this locally, you need to enable work items at group level. This can be done by enabling the namespace_level_work_items feature flag.

  2. Checkout master branch, and log in as any user who is not a guest in a group (developer, maintainer, owner or admin). I used the root user for this step.

  3. Visit the group's Epics page and try to create a new Epic (You should see a modal when you click on New Epic)

  4. Log in as a user who is a guest in your group

  5. Navigate to the work items page for the group. For example, (http://127.0.0.1:3000/groups/flightjs/-/work_items)

  6. Click on the newly created Epic/Work item

  7. As guest on master, you will be able to see the button to Add linked items. This is not expected, as linking of Epics is only allowed when the instance has a licence.

    Screenshot 2024-06-11 at 17.16.19.png

  8. Checkout this MR's branch (jj-451457-work-item-relation-permissions-b)

  9. When your local instance does not have a licence you should not see the Add button (whether logged in as guest or admin)

    image.png

  10. When your local instance has a valid license, the 'Add' button should again be visible

Edited by Joseph Wambua

Merge request reports