Small fix to user switching, roles should be correctly reset now.

This commit is contained in:
Robin Eklund 2011-08-04 16:27:57 +02:00
parent 2c8df42a18
commit e9273a97eb

@ -157,6 +157,7 @@ public class SciProSession extends WebSession {
user = userDao.save(user);
}
//Assign roles
iRoles.clear();
if(roleDao.isStudent(user)){
iRoles.add(new Student());
}
@ -208,7 +209,6 @@ public class SciProSession extends WebSession {
return false;
logger.info("Currently logged in user: '"+user.getEmailAddress()+"' attempting switch to '"+suUser+"@"+suRealm+"'");
if(suUser != null && roleDao.isSysadmin(user)){
iRoles.clear();
return signInAuthenticatedUser(suUser, suRealm);
}else{
logger.error("User does not have the privilege to switch user");