]> source.dussan.org Git - archiva.git/commitdiff
[MRM-668]
authorMaria Odea B. Ching <oching@apache.org>
Tue, 29 Jan 2008 08:05:45 +0000 (08:05 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Tue, 29 Jan 2008 08:05:45 +0000 (08:05 +0000)
-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

archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ArchivaXworkUser.java

index 051c1ff1032672630ebca1cd257e6edab9c1ac1a..37df624f218a4077157a3c0b86ede564c34007a3 100644 (file)
@@ -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()