Skip to content

Commit

Permalink
fix: Validation for OUMoude [DHIS2-11755] (dhis2#9114)
Browse files Browse the repository at this point in the history
* fix: OuMode validation in event query

* chore: More readable error messages.

* chore: Code formatting

* fix: Accessible ouMode per program protection level

* Revert "fix: Accessible ouMode per program protection level"

This reverts commit edc2703.

* fix: Accessible ouMode per program protection level

* fix: OuMode validation in event query

* fix: Validation for OUMoude
  • Loading branch information
abyot authored Oct 24, 2021
1 parent 8345bb0 commit a3b4bea
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1056,14 +1056,19 @@ private String getOuModeViolation( EventSearchParams params, User user )
violation = userCanSearchOuModeALL( user ) ? null
: "Current user is not authorized to query across all organisation units";
break;
case ACCESSIBLE:
case CAPTURE:
violation = user == null ? "User is required for ouMode: " + params.getOrgUnitSelectionMode() : null;
break;
case CHILDREN:
case SELECTED:
case DESCENDANTS:
violation = params.getOrgUnit() == null
? "Organisation unit is required for ouMode: " + params.getOrgUnitSelectionMode()
: null;
break;
default:
violation = null;
violation = "Invalid ouMode: " + params.getOrgUnitSelectionMode();
break;
}

Expand Down

0 comments on commit a3b4bea

Please sign in to comment.