User: danch   
  Date: 02/02/28 11:21:13

  Modified:    jetty/src/main/org/jboss/jetty Tag: Branch_2_4
                        JBossUserRealm.java
  Log:
  finished the 'fix' for the NotSerializableException
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.6   +7 -5      contrib/jetty/src/main/org/jboss/jetty/Attic/JBossUserRealm.java
  
  Index: JBossUserRealm.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/Attic/JBossUserRealm.java,v
  retrieving revision 1.2.2.5
  retrieving revision 1.2.2.6
  diff -u -r1.2.2.5 -r1.2.2.6
  --- JBossUserRealm.java       22 Feb 2002 19:24:03 -0000      1.2.2.5
  +++ JBossUserRealm.java       28 Feb 2002 19:21:13 -0000      1.2.2.6
  @@ -5,7 +5,7 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: JBossUserRealm.java,v 1.2.2.5 2002/02/22 19:24:03 danch Exp $
  +// $Id: JBossUserRealm.java,v 1.2.2.6 2002/02/28 19:21:13 danch Exp $
   
   package org.jboss.jetty;
   
  @@ -26,7 +26,7 @@
   /** An implementation of UserRealm that integrates with the JBossSX
    * security manager associted with the web application.
    * @author  [EMAIL PROTECTED]
  - * @version $Revision: 1.2.2.5 $
  + * @version $Revision: 1.2.2.6 $
    *
    * <p><b>Revisions:</b>
    * 
  @@ -77,12 +77,13 @@
            String userName = this.getName(); // needs disambiguation
   
            // Get the JBoss security manager from the ENC context
  -         if (_securityMgr != null && _securityMgr.isValid(this, password)) {
  +         SimplePrincipal propogationPrincipal = new SimplePrincipal(userName);
  +         if (_securityMgr != null && _securityMgr.isValid(propogationPrincipal, 
password.toCharArray())) {
               authenticated = true;
               _log.info("Security- User: "+userName + " is authenticated");
               // work around the fact that we are not serialisable - thanks Anatoly
                 //     SecurityAssociation.setPrincipal(this);
  -              SecurityAssociation.setPrincipal(new SimplePrincipal(userName));
  +              SecurityAssociation.setPrincipal(propogationPrincipal);
               SecurityAssociation.setCredential(password.toCharArray());
            } else {
               _log.warn("Security- User: "+userName + " is NOT authenticated");
  @@ -97,8 +98,9 @@
   
            // Get the JBoss security manager from the ENC context
            SimplePrincipal rolePrincipal = new SimplePrincipal(role);
  +         SimplePrincipal propogationPrincipal = new SimplePrincipal(userName);
            Set requiredRoles = Collections.singleton(rolePrincipal);
  -         if (_realmMapping.doesUserHaveRole(this, requiredRoles)) {
  +         if (_realmMapping.doesUserHaveRole(propogationPrincipal, requiredRoles)) {
               isUserInRole = true;
               _log.info("Security- User: "+userName + " is in Role: "+role);
            } else {
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to