Closed GeoffreyHuck closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
2e03f87
) to head (85ba358
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
fixes #1090
Add
personal_info_access_approval_to_current_user
in the response, which is the max value among the groups for which both the current user is implicitly manager of, and the user requested is descendant of.Notes:
userViewByLogin
service is affected in the same way (/users/by-login/{login}), as the same code serves the two servicesImplementation
We already get the list of groups of which the current-user is a manager and of which the user is a descendant of (for the field
ancestors_current_user_is_manager_of
). So to avoid doing another query for this, the values ofrequire_personal_info_access_approval
were added in theselect
of the existing query.Then, with the result of the query, we fill the groups information and we compute the
max
.Another way of doing would have been to create a query just for it, but since it requires to check the same groups as
ancestors_current_user_is_manager_of
, we would have done almost the same work twice.Query index
Only added a field in the
select
, so there's no need for a new index.Review
Probably easier all at once because there are a few refactoring to make the code clearer.