fix: no access to tracker programs or no tracker programs DHIS2-17959 #19905
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes bug introduced in #17343 (https://dhis2.atlassian.net/browse/DHIS2-17236)
The fix makes the assumption on which https://dhis2.atlassian.net/browse/DHIS2-17236 is built. TEs are meant to be tracked in tracker programs. Thus, a user must be able to enroll a TE into a tracker program to have access to the TE when its not enrolled yet.
This means that an instance without tracker programs can be treated like the above case.
Other changes
program
vsprograms
meant. They are mutually exclusive so we could think of ways to ensure this is the case on master (don't want to refactor more here).Tests
TrackedEntityInstanceStoreTest
which failed due to the same reason as reported in the jira issue before making any change. Note that the tests are at the store layer and simulate a user with no access sinceparams.accessibleTrackerPrograms
is empty.https://github.com/dhis2/wow-backend/blob/master/guides/testing/metadata_sync_testing.md