@@ -183,18 +183,18 @@ public List<User> getAllByDistrictsAndUserRights(List<District> districts, Colle
183
183
return em .createQuery (cq ).getResultList ();
184
184
}
185
185
186
- /**
187
- * Loads users filtered by combinable filter conditions.<br />
188
- * Condition combination if parameter is set:<br />
189
- * {@code ((regionUuids & districtUuids & filterByJurisdiction & userRoles) | includeSupervisors) & activeOnly}
190
- *
191
- * @see #createCurrentUserJurisdictionFilter(CriteriaBuilder, From)
192
- * @param regionUuids
193
- * @param districtUuids
194
- * @param filterByCurrentUserJurisdiction
195
- * @param activeOnly
196
- * @param userRights
197
- */
186
+ /**
187
+ * Loads users filtered by combinable filter conditions.<br />
188
+ * Condition combination if parameter is set:<br />
189
+ * {@code ((regionUuids & districtUuids & filterByJurisdiction & userRoles) | includeSupervisors) & activeOnly}
190
+ *
191
+ * @param regionUuids
192
+ * @param districtUuids
193
+ * @param filterByCurrentUserJurisdiction
194
+ * @param activeOnly
195
+ * @param userRights
196
+ * @see #createCurrentUserJurisdictionFilter(CriteriaBuilder, From)
197
+ */
198
198
public List <UserReference > getUserReferences (List <String > regionUuids , List <String > districtUuids , boolean activeOnly , UserRight ... userRights ) {
199
199
200
200
return getUserReferences (regionUuids , districtUuids , null , activeOnly , userRights );
@@ -219,19 +219,19 @@ public List<UserReference> getUserReferences(
219
219
return getUserReferences (regionUuids , districtUuids , communityUuids , activeOnly , limitedDisease , false , Arrays .asList (userRights ));
220
220
}
221
221
222
- /**
223
- * Loads users filtered by combinable filter conditions.<br />
224
- * Condition combination if parameter is set:<br />
225
- * {@code ((regionUuids & districtUuids & communityUuids & filterByJurisdiction & userRoles) | includeSupervisors) & activeOnly}
226
- *
227
- * @see #createCurrentUserJurisdictionFilter(CriteriaBuilder, From)
228
- * @param regionUuids
229
- * @param districtUuids
230
- * @param communityUuids
231
- * @param filterByJurisdiction
232
- * @param activeOnly
233
- * @param userRights
234
- */
222
+ /**
223
+ * Loads users filtered by combinable filter conditions.<br />
224
+ * Condition combination if parameter is set:<br />
225
+ * {@code ((regionUuids & districtUuids & communityUuids & filterByJurisdiction & userRoles) | includeSupervisors) & activeOnly}
226
+ *
227
+ * @param regionUuids
228
+ * @param districtUuids
229
+ * @param communityUuids
230
+ * @param filterByJurisdiction
231
+ * @param activeOnly
232
+ * @param userRights
233
+ * @see #createCurrentUserJurisdictionFilter(CriteriaBuilder, From)
234
+ */
235
235
public List <UserReference > getUserReferences (
236
236
List <String > regionUuids ,
237
237
List <String > districtUuids ,
@@ -654,7 +654,7 @@ public static String setNewPassword(User user) {
654
654
}
655
655
656
656
public String generatePassword () {
657
- return PasswordHelper .generatePasswordWithSpecialChars (12 );
657
+ return PasswordHelper .createPass (12 );
658
658
}
659
659
660
660
public String updatePassword (String userUuid , String password ) {
@@ -763,7 +763,6 @@ public Long countByAssignedOfficer(User officer, UserRight userRights) {
763
763
}
764
764
765
765
/**
766
- *
767
766
* @param districts
768
767
* @param userRight
769
768
* @return Number of users with specified UserRight on district level
@@ -782,7 +781,6 @@ public Long countByDistricts(List<District> districts, UserRight userRight) {
782
781
}
783
782
784
783
/**
785
- *
786
784
* @param districts
787
785
* @return Number of users with specified UserRight on community level
788
786
*/
@@ -799,11 +797,10 @@ public Long countByCommunities(List<District> districts, UserRight userRight) {
799
797
return em .createQuery (cq ).getSingleResult ();
800
798
}
801
799
802
- /**
803
- *
804
- * @param districts
805
- * @return Number of users with specified UserRight on health facility level
806
- */
800
+ /**
801
+ * @param districts
802
+ * @return Number of users with specified UserRight on health facility level
803
+ */
807
804
public Long countByHealthFacilities (List <District > districts , UserRight userRight ) {
808
805
809
806
CriteriaBuilder cb = em .getCriteriaBuilder ();
@@ -817,11 +814,10 @@ public Long countByHealthFacilities(List<District> districts, UserRight userRigh
817
814
return em .createQuery (cq ).getSingleResult ();
818
815
}
819
816
820
- /**
821
- *
822
- * @param districts
823
- * @return Number of users with specified UserRight on pointOfEntry level
824
- */
817
+ /**
818
+ * @param districts
819
+ * @return Number of users with specified UserRight on pointOfEntry level
820
+ */
825
821
public Long countByPointOfEntries (List <District > districts , UserRight userRight ) {
826
822
827
823
CriteriaBuilder cb = em .getCriteriaBuilder ();
@@ -847,10 +843,9 @@ public boolean hasRegion(RegionReferenceDto regionReference) {
847
843
return currentUser .getRegion ().getUuid ().equals (regionReference .getUuid ());
848
844
}
849
845
850
- /**
851
- * @param root
852
- * root to {@link User} or {@link UserReference}.
853
- */
846
+ /**
847
+ * @param root root to {@link User} or {@link UserReference}.
848
+ */
854
849
private Predicate createDefaultFilter (CriteriaBuilder cb , From <?, ?> root ) {
855
850
return cb .isTrue (root .get (User .ACTIVE ));
856
851
}
0 commit comments