diff --git a/src/main/java/org/olat/basesecurity/BaseSecurityManager.java b/src/main/java/org/olat/basesecurity/BaseSecurityManager.java index 651f1d4dd21a4fd1b0427eb32b2c3e52ee51e8c2..c1d7bc3cc9a19c321eb5816fea7235e4a9747ce3 100644 --- a/src/main/java/org/olat/basesecurity/BaseSecurityManager.java +++ b/src/main/java/org/olat/basesecurity/BaseSecurityManager.java @@ -1517,6 +1517,16 @@ public class BaseSecurityManager implements BaseSecurity { boolean hasPermissionOnResources = (params.getPermissionOnResources() != null && params.getPermissionOnResources().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 StringBuilder sb = new StringBuilder(5000); if (hasAuthProviders) {