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:
- Login with a user who has Guest role
- Go to any Project > Issues > List
- Create an new Objective/Key result under New issue split button
- Go to Objective/Key result detail page
- Click on the top right icon to add it in your todos
- Click again to mark it as done
- There should be no error
On similar lines, a task can be added to the issue in the Tasks section.
- Login with a user who has Guest role
- Go to any Project > Issues > List
- Create an Issue
- Go to Issue detail page > Tasks section
- Add a Key Task
- Click on the newly added item to open it in a modal
- Click on the top right todo icon
- Clicking on it again will mark it as done
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #412830 (closed)