Delete todos when users loses target read permissions
What does this MR do?
It removes todos when a user loses permissions to a todo target. That can happen in following cases
- a user leaves/is removed from a private project (all todos of this project targets for the user will be removed)
- a user leaves/is removed from a private group (all todos of this project targets including subgroups projects will be removed for the user)
- a project is made private (all todos of all users not authorized to see the project will be removed)
Removing group todos will be part of adding group todos MR.
Are there points in the code the reviewer needs to double check?
- Are all cases included?
- Are there no other places in code that were missed?
Why was this MR needed?
This is first of 3 planned MRs that will come to finalize todos for epics. This part is common for CE and EE. We plan to simplify TodosFinder
query and skip authorization check there and therefore need to remove todos for targets a user loses access to.
Following MRs:
- migration MR - remove all todos for targets users don't have access to
- add group todos (epic todos for EE)
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conform to the code review guidelines
-
Has been reviewed by a UX Designer -
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conform to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
gitlab-org/gitlab-ee#5481
Edited by Yorick Peterse