get current user from SecurityService, not from shiro directly

This commit is contained in:
Thomas Wiese committed 2018-11-19 17:19:02 +01:00
1 parent fd1498e0b3
commit 7a398628cc
1 file changed
+4 -3
@@ -26,6 +26,7 @@ import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
import com.sap.sse.common.impl.MillisecondsTimePoint;
import com.sap.sse.security.SecurityService;
import com.sap.sse.security.shared.User;
public class TaggingServiceImpl implements TaggingService {
@@ -44,11 +45,11 @@ public class TaggingServiceImpl implements TaggingService {
* @return username of current user
*/
private String getCurrentUsername() throws AuthorizationException {
Object principal = SecurityUtils.getSubject().getPrincipal();
if (principal == null) {
User user = getSecurityService().getCurrentUser();
if (user == null) {
throw new AuthorizationException();
}
return principal.toString();
return user.getName();
}
/**