@NotNull
@Override
public CompiledUserProfile getCompiledUserProfile(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
MidPointPrincipal principal = null;
try {
principal = securityContextManager.getPrincipal();
} catch (SecurityViolationException e) {
LOGGER.warn("Security violation while getting principlal to get GUI config: {}", e.getMessage(), e);
}
if (principal == null || !(principal instanceof MidPointUserProfilePrincipal)) {
return userProfileCompiler.getGlobalCompiledUserProfile(task, parentResult);
} else {
return ((MidPointUserProfilePrincipal)principal).getCompiledUserProfile();
}
}