Skip to content
Snippets Groups Projects
Commit a03463a5 authored by Daniel Haag's avatar Daniel Haag
Browse files

OPENOLAT-14: wildcard prefix for studysubject in the usersearch.

parent 1807c3b6
No related branches found
No related tags found
No related merge requests found
...@@ -1517,6 +1517,16 @@ public class BaseSecurityManager implements BaseSecurity { ...@@ -1517,6 +1517,16 @@ public class BaseSecurityManager implements BaseSecurity {
boolean hasPermissionOnResources = (params.getPermissionOnResources() != null && params.getPermissionOnResources().length > 0); boolean hasPermissionOnResources = (params.getPermissionOnResources() != null && params.getPermissionOnResources().length > 0);
boolean hasAuthProviders = (params.getAuthProviders() != null && params.getAuthProviders().length > 0); boolean hasAuthProviders = (params.getAuthProviders() != null && params.getAuthProviders().length > 0);
// some special handling for searching with some of the user properties
if((params.getUserProperties() != null) && (params.getUserProperties().containsKey(UserConstants.STUDYSUBJECT))) {
String searchPhrase = params.getUserProperties().get(UserConstants.STUDYSUBJECT);
if(searchPhrase.charAt(0) != '*') {
// add a "*" to make sure the user gets all the requested
// users with the given study subject
params.getUserProperties().put(UserConstants.STUDYSUBJECT, "*" + searchPhrase);
}
}
// select identity and inner join with user to optimize query // select identity and inner join with user to optimize query
StringBuilder sb = new StringBuilder(5000); StringBuilder sb = new StringBuilder(5000);
if (hasAuthProviders) { if (hasAuthProviders) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment