Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#12566 - Task synchronization on Android pulls tasks not related with… #12621

Merged

Conversation

sergiupacurariu
Copy link
Contributor

… the user's jurisdiction

Fixes #12566

@sormas-vitagroup
Copy link
Contributor

Copy link
Contributor

@MateStrysewske MateStrysewske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is not fixed for me, at least not fully; environment officers still pull tasks related to all/a lot of other entities that they don't have access to.

@sormas-vitagroup
Copy link
Contributor

Copy link
Contributor

@MateStrysewske MateStrysewske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine; just one change request in terms of code readability

… the user's jurisdiction - review change request
@sormas-vitagroup
Copy link
Contributor

@@ -290,8 +290,12 @@ public List<UserReference> getUserReferences(
userEntityJoinUsed = true;
}
if (filterByJurisdiction) {
filter = CriteriaBuilderHelper.and(cb, filter, createCurrentUserJurisdictionFilter(cb, userRoot));
userEntityJoinUsed = true;
if (hasRight(UserRight.SEE_PERSONAL_DATA_OUTSIDE_JURISDICTION)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the conjunction stuff is probably pretty unnecessary; you can shorten this section to

if (!hasRight(...)) {
  filter = CriteriaBuilderHelper.and(cb, filter, createCurrentUserJurisdictionFilter(....));
  ...
}

…ts if the CASE_SURVEILANCE feature is disabled
@sormas-vitagroup
Copy link
Contributor

@sormas-vitagroup
Copy link
Contributor

filter = CriteriaBuilderHelper.and(cb, filter, createCurrentUserJurisdictionFilter(cb, userRoot));
userEntityJoinUsed = true;
}
// if (filterByJurisdiction) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented code; you can merge the PR afterwards :)

@sormas-vitagroup
Copy link
Contributor

@sergiupacurariu sergiupacurariu merged commit bb06ef0 into development Oct 20, 2023
10 of 11 checks passed
@sergiupacurariu sergiupacurariu deleted the bugfix-12566_task_sync_not_related_to_jurisdiction branch October 20, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task synchronization on Android pulls tasks not related with the user's jurisdiction
3 participants