From f196ce2e79c2f1848dc71849b452f9907ebfdb39 Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Tue, 29 Jan 2008 08:05:45 +0000 Subject: [PATCH] [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 --- .../maven/archiva/web/util/ArchivaXworkUser.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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() -- 2.39.5