Skip to content

Allow guest user to add work items in the todos list

What does this MR do and why?

The guest users are not able to add todos for work items. workItemUpdate graphQL mutation updates all widgets checksupdate_work_item permission when todos widget requires the more lenient create_todo permission. Change mutation from workItemUpdate to todoMarkDone and todoCreate for allowing guest user to add todos.

Screenshots or screen recordings

No visual changes impacted

How to set up and validate locally

Prerequisites: Enable the following feature flag to create objects supporting this feature using gdk rails console:

Feature.enable(:okrs_mvc, Project.find_by_full_path('gitlab-org/gitlab-test'))

Steps:

  1. Login with a user who has Guest role
  2. Go to any Project > Issues > List
  3. Create an new Objective/Key result under New issue split button
  4. Go to Objective/Key result detail page
  5. Click on the top right icon Screenshot_2023-04-20_at_9.42.44_AM.png to add it in your todos
  6. Click again to mark it as done
  7. There should be no error

On similar lines, a task can be added to the issue in the Tasks section.

  1. Login with a user who has Guest role
  2. Go to any Project > Issues > List
  3. Create an Issue
  4. Go to Issue detail page > Tasks section
  5. Add a Key Task
  6. Click on the newly added item to open it in a modal
  7. Click on the top right todo icon Screenshot_2023-04-20_at_9.42.44_AM.png
  8. Clicking on it again will mark it as done
  9. There should be no error

MR acceptance checklist

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

Related to #412830 (closed)

Edited by Rajan Mistry

Merge request reports