Tweak timelog GraphQL resolver logic to enforce group/project or user
What does this MR do and why?
Related to #406549 and #425747
Because Timelog authorization checks happen AFTER pagination we can find ourselves in a situation where no timelogs are returned even though some are available.
By enforcing a filter on project, group or current (unless admin) we know that timelogs won't get filtered out post pagination (by auth checks).
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Run some GraphQL queries...
This should only work when you're logged in as an admin:
query {
timelogs {
nodes {
id
}
}
}
When logged in as a non admin you can get it to work by providing groupId, projectId or username arguments.