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

fix: Validate user authorized when mode ALL in enrollments [TECH-1589] #15583

Merged
merged 13 commits into from
Nov 7, 2023

Conversation

muilpp
Copy link
Contributor

@muilpp muilpp commented Nov 3, 2023

When org unit mode ALL, tracked entities and enrollments need to validate the user is authorized to use the mode.
That means the user has to either be a superuser or have the authority F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS. For now we will also consider the user being null a valid scenario to use the ALL mode, because the scheduler runs tasks with a null user.

These changes have been applied to the new and old API.
Ticket: https://dhis2.atlassian.net/browse/TECH-1589

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #15583 (c61c595) into master (acaad5a) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 71.42%.

@@             Coverage Diff              @@
##             master   #15583      +/-   ##
============================================
+ Coverage     66.23%   66.24%   +0.01%     
- Complexity    31250    31265      +15     
============================================
  Files          3485     3485              
  Lines        129791   129788       -3     
  Branches      15145    15145              
============================================
+ Hits          85964    85981      +17     
+ Misses        36742    36726      -16     
+ Partials       7085     7081       -4     
Flag Coverage Δ
integration 49.81% <28.57%> (+0.02%) ⬆️
integration-h2 32.42% <14.28%> (-0.01%) ⬇️
unit 30.34% <71.42%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...dhis/tracker/export/OperationsParamsValidator.java 65.21% <100.00%> (ø)
...er/export/enrollment/DefaultEnrollmentService.java 62.17% <ø> (+0.92%) ⬆️
...rt/enrollment/EnrollmentOperationParamsMapper.java 94.82% <100.00%> (+0.09%) ⬆️
...ckedentity/TrackedEntityOperationParamsMapper.java 91.17% <100.00%> (+1.55%) ⬆️
...r/deprecated/tracker/EnrollmentCriteriaMapper.java 78.18% <50.00%> (-0.25%) ⬇️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acaad5a...c61c595. Read the comment docs.

@muilpp muilpp changed the title fix: Remove unnecessary capture mode check [TECH-1589] fix: Validate user authorized when mode ALL in enrollments [TECH-1589] Nov 6, 2023
Copy link

sonarqubecloud bot commented Nov 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@muilpp muilpp marked this pull request as ready for review November 6, 2023 13:41
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.

2 participants