From: Maria Odea B. Ching Date: Tue, 29 Jan 2008 08:05:45 +0000 (+0000) Subject: [MRM-668] X-Git-Tag: archiva-1.0.1~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f196ce2e79c2f1848dc71849b452f9907ebfdb39;p=archiva.git [MRM-668] -get the security session using SecuritySystemConstants.SECURITY_SESSION_KEY or SecuritySession.ROLE in ArchivaXWorkUser git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-1.0.x@616198 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ArchivaXworkUser.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ArchivaXworkUser.java index 051c1ff10..37df624f2 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ArchivaXworkUser.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ArchivaXworkUser.java @@ -56,7 +56,15 @@ public class ArchivaXworkUser private SecuritySession getSecuritySession() { - return (SecuritySession) getContextSession().get( SecuritySession.ROLE ); + SecuritySession securitySession = + (SecuritySession) getContextSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY ); + + if ( securitySession == null ) + { + securitySession = (SecuritySession) getContextSession().get( SecuritySession.ROLE ); + } + + return securitySession; } public String getActivePrincipal()