continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r440232 - /maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
Date Tue, 05 Sep 2006 03:17:18 GMT
Author: carlos
Date: Mon Sep  4 20:17:18 2006
New Revision: 440232

URL: http://svn.apache.org/viewvc?view=rev&rev=440232
Log:
Deprecate Continuum user objects, fixing ClassCastException

Modified:
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java?view=diff&rev=440232&r1=440231&r2=440232
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
Mon Sep  4 20:17:18 2006
@@ -23,12 +23,11 @@
 
 import org.acegisecurity.GrantedAuthority;
 import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.userdetails.User;
 import org.acegisecurity.userdetails.UserDetails;
 import org.acegisecurity.userdetails.UserDetailsService;
 import org.acegisecurity.userdetails.UsernameNotFoundException;
-import org.apache.maven.continuum.model.system.ContinuumUser;
 import org.apache.maven.continuum.model.system.Permission;
+import org.apache.maven.user.model.User;
 import org.apache.maven.user.model.UserManager;
 import org.springframework.dao.DataAccessException;
 
@@ -61,9 +60,7 @@
     public UserDetails loadUserByUsername( String username )
         throws UsernameNotFoundException, DataAccessException
     {
-        ContinuumUser user;
-
-        user = (ContinuumUser) userManager.getUser( username );
+        User user = userManager.getUser( username );
 
         if ( user == null )
         {
@@ -78,7 +75,7 @@
      * @param user the continuum user loaded from DB
      * @return the Acegi user
      */
-    UserDetails getUserDetails( ContinuumUser user )
+    UserDetails getUserDetails( User user )
     {
         List permissions = user.getGroup().getPermissions();
 
@@ -106,8 +103,9 @@
         boolean credentialsNonExpired = true;
         boolean accountNonLocked = true;
 
-        UserDetails userDetails = new User( username, password, enabled, accountNonExpired,
credentialsNonExpired,
-                                            accountNonLocked, grantedAuthorities );
+        UserDetails userDetails = new org.acegisecurity.userdetails.User( username, password,
enabled,
+                                                                          accountNonExpired,
credentialsNonExpired,
+                                                                          accountNonLocked,
grantedAuthorities );
 
         return userDetails;
     }



Mime
View raw message