PL-6104 Fix user substitutions

This commit is contained in:
Yuriy Artamonov 2016-07-28 17:14:26 +04:00
parent d3ce145e90
commit dae9abc1ff
2 changed files with 9 additions and 2 deletions

View File

@ -45,7 +45,10 @@ public class Connection {
public void login(String login, String password, Locale locale) throws LoginException {
UserSession userSession = doLogin(login, password, locale, getLoginParams());
session = new ClientUserSession(userSession);
ClientUserSession clientUserSession = new ClientUserSession(userSession);
clientUserSession.setAuthenticated(true);
session = clientUserSession;
AppContext.setSecurityContext(new SecurityContext(session));
log.info("Logged in: " + session);

View File

@ -188,7 +188,11 @@ public abstract class AbstractConnection implements Connection {
@Override
public void substituteUser(User substitutedUser) {
setSession(new ClientUserSession(loginService.substituteUser(substitutedUser)));
ClientUserSession clientUserSession = new ClientUserSession(loginService.substituteUser(substitutedUser));
clientUserSession.setAuthenticated(true);
setSession(clientUserSession);
fireSubstitutionListeners();
}