diff options
author | Brett Porter <brett@apache.org> | 2009-03-11 16:53:17 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-03-11 16:53:17 +0000 |
commit | f63959e3aa1694a987c852086df73d205b3ceddc (patch) | |
tree | f41e0256a6c0a3820719de41d63f13f7f15cac4a /archiva-modules/archiva-web/archiva-security | |
parent | 11edfc69181361430b0459a945f0c8c4722e7cdf (diff) | |
download | archiva-f63959e3aa1694a987c852086df73d205b3ceddc.tar.gz archiva-f63959e3aa1694a987c852086df73d205b3ceddc.zip |
[MRM-1101] restore proper tracking of principal in DAV for audit logging
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@752519 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-security')
2 files changed, 4 insertions, 19 deletions
diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java index 29f7498f1..88b3f628e 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java +++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java @@ -25,7 +25,6 @@ import org.codehaus.plexus.redback.system.SecuritySession; import org.codehaus.plexus.redback.system.SecuritySystemConstants; import org.codehaus.plexus.redback.users.User; import org.codehaus.plexus.redback.users.UserManager; -import org.codehaus.plexus.registry.Registry; /** * ArchivaXworkUser @@ -37,35 +36,20 @@ public class ArchivaXworkUser { public String getActivePrincipal( Map<String, Object> sessionMap ) { - if ( sessionMap == null ) - { - return getGuest(); - } - SecuritySession securitySession = (SecuritySession) sessionMap.get( SecuritySystemConstants.SECURITY_SESSION_KEY ); if ( securitySession == null ) { - securitySession = (SecuritySession) sessionMap.get( SecuritySession.ROLE ); - } - - if ( securitySession == null ) - { - return getGuest(); + return UserManager.GUEST_USERNAME; } User user = securitySession.getUser(); if ( user == null ) { - return getGuest(); + return UserManager.GUEST_USERNAME; } return (String) user.getPrincipal(); } - - public String getGuest() - { - return UserManager.GUEST_USERNAME; - } } diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/SecurityStartup.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/SecurityStartup.java index 9b589d791..b81b7a5fa 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/SecurityStartup.java +++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/SecurityStartup.java @@ -33,6 +33,7 @@ import org.codehaus.plexus.redback.rbac.RBACManager; import org.codehaus.plexus.redback.rbac.RbacManagerException; import org.codehaus.plexus.redback.rbac.UserAssignment; import org.codehaus.plexus.redback.system.check.EnvironmentCheck; +import org.codehaus.plexus.redback.users.UserManager; import org.codehaus.plexus.registry.Registry; import org.codehaus.plexus.registry.RegistryListener; import org.slf4j.Logger; @@ -88,7 +89,7 @@ public class SecurityStartup { String repoId = repoConfig.getId(); - String principal = archivaXworkUser.getGuest(); + String principal = UserManager.GUEST_USERNAME; try { |